[llvm] 86195b8 - [ValueTracking] Remove branch-on-poison-as-ub flag (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 02:05:11 PST 2023


Author: Nikita Popov
Date: 2023-01-02T11:05:01+01:00
New Revision: 86195b8361d98210fc362609aceae324c8bc467a

URL: https://github.com/llvm/llvm-project/commit/86195b8361d98210fc362609aceae324c8bc467a
DIFF: https://github.com/llvm/llvm-project/commit/86195b8361d98210fc362609aceae324c8bc467a.diff

LOG: [ValueTracking] Remove branch-on-poison-as-ub flag (NFC)

This has been enabled by default without issue for a while now,
remove the flag.

Added: 
    

Modified: 
    llvm/lib/Analysis/ValueTracking.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 8fe98b5ba427a..5a4d748e603ec 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -83,15 +83,6 @@ using namespace llvm::PatternMatch;
 static cl::opt<unsigned> DomConditionsMaxUses("dom-conditions-max-uses",
                                               cl::Hidden, cl::init(20));
 
-// According to the LangRef, branching on a poison condition is absolutely
-// immediate full UB.  However, historically we haven't implemented that
-// consistently as we had an important transformation (non-trivial unswitch)
-// which introduced instances of branch on poison/undef to otherwise well
-// defined programs.  This issue has since been fixed, but the flag is
-// temporarily retained to easily diagnose potential regressions.
-static cl::opt<bool> BranchOnPoisonAsUB("branch-on-poison-as-ub",
-                                        cl::Hidden, cl::init(true));
-
 
 /// Returns the bitwidth of the given scalar or pointer type. For vector types,
 /// returns the element type's bitwidth.
@@ -5772,12 +5763,11 @@ void llvm::getGuaranteedNonPoisonOps(const Instruction *I,
     Operands.insert(I->getOperand(1));
     break;
   case Instruction::Switch:
-    if (BranchOnPoisonAsUB)
-      Operands.insert(cast<SwitchInst>(I)->getCondition());
+    Operands.insert(cast<SwitchInst>(I)->getCondition());
     break;
   case Instruction::Br: {
     auto *BR = cast<BranchInst>(I);
-    if (BranchOnPoisonAsUB && BR->isConditional())
+    if (BR->isConditional())
       Operands.insert(BR->getCondition());
     break;
   }


        


More information about the llvm-commits mailing list