llvm.org GIT mirror llvm / 21ade9b
Rename isKnownNotFullPoison to programUndefinedIfPoison; NFC Summary: programUndefinedIfPoison makes more sense, given what the function does; and I'm about to add a function with a name similar to isKnownNotFullPoison (so do the rename to avoid confusion). Reviewers: broune, majnemer, bjarke.roune Reviewed By: broune Subscribers: mcrosier, llvm-commits, mzolotukhin Differential Revision: https://reviews.llvm.org/D30444 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301776 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjoy Das 2 years ago
5 changed file(s) with 6 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
416416 ///
417417 /// Note that this currently only considers the basic block that is
418418 /// the parent of I.
419 bool isKnownNotFullPoison(const Instruction *PoisonI);
419 bool programUndefinedIfFullPoison(const Instruction *PoisonI);
420420
421421 /// \brief Specific patterns of select instructions we can match.
422422 enum SelectPatternFlavor {
50285028 return false;
50295029
50305030 // Only proceed if we can prove that I does not yield poison.
5031 if (!isKnownNotFullPoison(I)) return false;
5031 if (!programUndefinedIfFullPoison(I))
5032 return false;
50325033
50335034 // At this point we know that if I is executed, then it does not wrap
50345035 // according to at least one of NSW or NUW. If I is not executed, then we do
38403840 }
38413841 }
38423842
3843 bool llvm::isKnownNotFullPoison(const Instruction *PoisonI) {
3843 bool llvm::programUndefinedIfFullPoison(const Instruction *PoisonI) {
38443844 // We currently only look for uses of poison values within the same basic
38453845 // block, as that makes it easier to guarantee that the uses will be
38463846 // executed given that PoisonI is executed.
11371137 // Add I to DominatingExprs if it's an add/sub that can't sign overflow.
11381138 if (match(I, m_NSWAdd(m_Value(LHS), m_Value(RHS))) ||
11391139 match(I, m_NSWSub(m_Value(LHS), m_Value(RHS)))) {
1140 if (isKnownNotFullPoison(I)) {
1140 if (programUndefinedIfFullPoison(I)) {
11411141 const SCEV *Key =
11421142 SE->getAddExpr(SE->getUnknown(LHS), SE->getUnknown(RHS));
11431143 DominatingExprs[Key].push_back(I);
204204 ret void
205205 }
206206
207 ; Demonstrate why we need a Visited set in llvm::isKnownNotFullPoison.
207 ; Demonstrate why we need a Visited set in llvm::programUndefinedIfFullPoison.
208208 define void @test-add-not-header5(float* %input, i32 %offset) {
209209 ; CHECK-LABEL: @test-add-not-header5
210210 entry: