[ValueTracking] Remove branch-on-poison-as-ub flag (NFC)
authorNikita Popov <npopov@redhat.com>
Mon, 2 Jan 2023 10:02:27 +0000 (11:02 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 2 Jan 2023 10:05:01 +0000 (11:05 +0100)
This has been enabled by default without issue for a while now,
remove the flag.

llvm/lib/Analysis/ValueTracking.cpp

index 8fe98b5..5a4d748 100644 (file)
@@ -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;
   }