diff options
author | Max Kazantsev <max.kazantsev@azul.com> | 2018-08-06 08:10:28 +0000 |
---|---|---|
committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-08-06 08:10:28 +0000 |
commit | 3271f379a9cdce9d67dbe0feefa0142ce5c36347 (patch) | |
tree | 5609fff210783b64ce2dcc6b89d717dd4cdda4f1 /llvm/lib/Analysis/ValueTracking.cpp | |
parent | ea1b0e09606eb7bbf808b786d8a39d0f0a616e28 (diff) | |
download | llvm-3271f379a9cdce9d67dbe0feefa0142ce5c36347.zip llvm-3271f379a9cdce9d67dbe0feefa0142ce5c36347.tar.gz llvm-3271f379a9cdce9d67dbe0feefa0142ce5c36347.tar.bz2 |
Revert rL338990 to see if it causes sanitizer failures
Multiple failues reported by sanitizer-x86_64-linux, seem to be caused by this
patch. Reverting to see if they sustain without it.
Differential Revision: https://reviews.llvm.org/D50172
llvm-svn: 338994
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 65c5d0e..edd46c5 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1861,36 +1861,18 @@ static bool isKnownNonNullFromDominatingCondition(const Value *V, continue; for (auto *CmpU : U->users()) { - SmallVector<const User *, 4> WorkList; - SmallPtrSet<const User *, 4> Visited; - Visited.insert(CmpU); - WorkList.push_back(CmpU); - - while (!WorkList.empty()) { - auto *Curr = WorkList.pop_back_val(); - - // If a user is an AND, add all its users to the work list. - if (auto *BO = dyn_cast<BinaryOperator>(Curr)) - if (BO->getOpcode() == Instruction::And) { - for (auto *BOU : BO->users()) - if (Visited.insert(BOU).second) - WorkList.push_back(BOU); - continue; - } - - if (const BranchInst *BI = dyn_cast<BranchInst>(Curr)) { - assert(BI->isConditional() && "uses a comparison!"); + if (const BranchInst *BI = dyn_cast<BranchInst>(CmpU)) { + assert(BI->isConditional() && "uses a comparison!"); - BasicBlock *NonNullSuccessor = - BI->getSuccessor(Pred == ICmpInst::ICMP_EQ ? 1 : 0); - BasicBlockEdge Edge(BI->getParent(), NonNullSuccessor); - if (Edge.isSingleEdge() && DT->dominates(Edge, CtxI->getParent())) - return true; - } else if (Pred == ICmpInst::ICMP_NE && - match(Curr, m_Intrinsic<Intrinsic::experimental_guard>()) && - DT->dominates(cast<Instruction>(Curr), CtxI)) { + BasicBlock *NonNullSuccessor = + BI->getSuccessor(Pred == ICmpInst::ICMP_EQ ? 1 : 0); + BasicBlockEdge Edge(BI->getParent(), NonNullSuccessor); + if (Edge.isSingleEdge() && DT->dominates(Edge, CtxI->getParent())) return true; - } + } else if (Pred == ICmpInst::ICMP_NE && + match(CmpU, m_Intrinsic<Intrinsic::experimental_guard>()) && + DT->dominates(cast<Instruction>(CmpU), CtxI)) { + return true; } } } |