diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-01-17 18:15:49 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-01-17 18:15:49 +0000 |
commit | 96669965635a85a01e915dc07526f92108498782 (patch) | |
tree | 6134f9c12e317d5136c8bd15ff5736a8726bf34b /llvm/lib/Analysis/AssumptionCache.cpp | |
parent | de55c606d10e9c09b03745de3a441a9097879366 (diff) | |
download | bcm5719-llvm-96669965635a85a01e915dc07526f92108498782.tar.gz bcm5719-llvm-96669965635a85a01e915dc07526f92108498782.zip |
[ValueTracking] recognize a 'not' of an assumed condition as false
Also, add the corresponding match to the AssumptionCache's 'Affected Values' list.
Differential Revision: https://reviews.llvm.org/D28485
llvm-svn: 292239
Diffstat (limited to 'llvm/lib/Analysis/AssumptionCache.cpp')
-rw-r--r-- | llvm/lib/Analysis/AssumptionCache.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/AssumptionCache.cpp b/llvm/lib/Analysis/AssumptionCache.cpp index 5851594700a..4e287e5f6bc 100644 --- a/llvm/lib/Analysis/AssumptionCache.cpp +++ b/llvm/lib/Analysis/AssumptionCache.cpp @@ -47,9 +47,11 @@ void AssumptionCache::updateAffectedValues(CallInst *CI) { } else if (auto *I = dyn_cast<Instruction>(V)) { Affected.push_back(I); - if (I->getOpcode() == Instruction::BitCast || - I->getOpcode() == Instruction::PtrToInt) { - auto *Op = I->getOperand(0); + // Peek through unary operators to find the source of the condition. + Value *Op; + if (match(I, m_BitCast(m_Value(Op))) || + match(I, m_PtrToInt(m_Value(Op))) || + match(I, m_Not(m_Value(Op)))) { if (isa<Instruction>(Op) || isa<Argument>(Op)) Affected.push_back(Op); } |