aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-05-05 21:59:18 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-05-05 21:59:18 +0000
commitb6e7cd655c6ee119dbeacc321ee92387f983edb0 (patch)
treee1aa6692a280bb8f1768af8804b5a3265a424acd /lib
parent108709d4d1ff02317972956540dad571bdf43e95 (diff)
downloadexternal_llvm-b6e7cd655c6ee119dbeacc321ee92387f983edb0.zip
external_llvm-b6e7cd655c6ee119dbeacc321ee92387f983edb0.tar.gz
external_llvm-b6e7cd655c6ee119dbeacc321ee92387f983edb0.tar.bz2
PR9838: Fix transform introduced in r127064 to not trigger when only one side of the icmp is an exact shift.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/InstructionSimplify.cpp2
-rw-r--r--lib/Transforms/InstCombine/InstCombineCompares.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index e7ef6ff..22a64e1 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -1847,7 +1847,7 @@ static Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
// fall-through
case Instruction::SDiv:
case Instruction::AShr:
- if (!LBO->isExact() && !RBO->isExact())
+ if (!LBO->isExact() || !RBO->isExact())
break;
if (Value *V = SimplifyICmpInst(Pred, LBO->getOperand(0),
RBO->getOperand(0), TD, DT, MaxRecurse-1))
diff --git a/lib/Transforms/InstCombine/InstCombineCompares.cpp b/lib/Transforms/InstCombine/InstCombineCompares.cpp
index bb9b88b..b6963c5 100644
--- a/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -2400,7 +2400,7 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
// fall-through
case Instruction::SDiv:
case Instruction::AShr:
- if (!BO0->isExact() && !BO1->isExact())
+ if (!BO0->isExact() || !BO1->isExact())
break;
return new ICmpInst(I.getPredicate(), BO0->getOperand(0),
BO1->getOperand(0));