summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-06-20 13:22:26 +0000
committerSanjay Patel <spatel@rotateright.com>2018-06-20 13:22:26 +0000
commit825a4faa8d655d1b753bdd737cc2648adc0ac3c8 (patch)
tree23a4279211b83ad53701ad67e6fed80cd34cb84b /llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
parent18b9bd7d6c84179f6f91104111c5b743e295499f (diff)
downloadbcm5719-llvm-825a4faa8d655d1b753bdd737cc2648adc0ac3c8.tar.gz
bcm5719-llvm-825a4faa8d655d1b753bdd737cc2648adc0ac3c8.zip
[InstCombine] ignore debuginfo when removing redundant assumes (PR37726)
This is similar to: rL335083 Fixes:: https://bugs.llvm.org/show_bug.cgi?id=37726 llvm-svn: 335121
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 3dde762dbcc..dd88b33546b 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -3672,9 +3672,11 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
break;
case Intrinsic::assume: {
Value *IIOperand = II->getArgOperand(0);
- // Remove an assume if it is immediately followed by an identical assume.
- if (match(II->getNextNode(),
- m_Intrinsic<Intrinsic::assume>(m_Specific(IIOperand))))
+ // Remove an assume if it is followed by an identical assume.
+ // TODO: Do we need this? Unless there are conflicting assumptions, the
+ // computeKnownBits(IIOperand) below here eliminates redundant assumes.
+ Instruction *Next = II->getNextNonDebugInstruction();
+ if (match(Next, m_Intrinsic<Intrinsic::assume>(m_Specific(IIOperand))))
return eraseInstFromFunction(CI);
// Canonicalize assume(a && b) -> assume(a); assume(b);
OpenPOWER on IntegriCloud