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
This commit is contained in:
Eli Friedman
2011-05-05 21:59:18 +00:00
parent 108709d4d1
commit b6e7cd655c
3 changed files with 13 additions and 2 deletions

View File

@ -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))