diff options
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 34f8abd..e11f5e2 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -4525,9 +4525,7 @@ bool llvm::isOverflowIntrinsicNoWrap(const WithOverflowInst *WO, return llvm::any_of(GuardingBranches, AllUsesGuardedByBranch); } -bool llvm::isGuaranteedNotToBeUndefOrPoison(const Value *V, - const Instruction *CtxI, - const DominatorTree *DT) { +bool llvm::isGuaranteedNotToBeUndefOrPoison(const Value *V) { // If the value is a freeze instruction, then it can never // be undef or poison. if (isa<FreezeInst>(V)) @@ -4560,29 +4558,6 @@ bool llvm::isGuaranteedNotToBeUndefOrPoison(const Value *V, return true; } - if (!CtxI || !DT) - return false; - - // If V is used as a branch condition before reaching CtxI, V cannot be - // undef or poison. - // br V, BB1, BB2 - // BB1: - // CtxI ; V cannot be undef or poison here - auto Dominator = DT->getNode(CtxI->getParent())->getIDom(); - while (Dominator) { - auto *TI = Dominator->getBlock()->getTerminator(); - - if (auto BI = dyn_cast<BranchInst>(TI)) { - if (BI->isConditional() && BI->getCondition() == V) - return true; - } else if (auto SI = dyn_cast<SwitchInst>(TI)) { - if (SI->getCondition() == V) - return true; - } - - Dominator = Dominator->getIDom(); - } - return false; } |