summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-07-30 04:36:32 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-07-30 04:36:32 +0000
commit4736916aa6e347a57083d19c2371bcd151cca8b3 (patch)
treeab2290ffba2326dca83199756f4f2a68cda9b334 /llvm/lib/Analysis/ScalarEvolution.cpp
parente9a0bae2386d8feb46b75ee4849099e69b9d3276 (diff)
downloadbcm5719-llvm-4736916aa6e347a57083d19c2371bcd151cca8b3.tar.gz
bcm5719-llvm-4736916aa6e347a57083d19c2371bcd151cca8b3.zip
Another SCEV issue from PR2607; essentially the same issue, but this
time applying to the implicit comparison in smin expressions. The correct way to transform an inequality into the opposite inequality, either signed or unsigned, is with a not expression. I looked through the SCEV code, and I don't think there are any more occurrences of this issue. llvm-svn: 54194
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 14c1389b434..bf6bc0b5dc2 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -1789,10 +1789,10 @@ SCEVHandle ScalarEvolutionsImpl::createSCEV(Value *V) {
if (LHS == U->getOperand(1) && RHS == U->getOperand(2))
return SE.getSMaxExpr(getSCEV(LHS), getSCEV(RHS));
else if (LHS == U->getOperand(2) && RHS == U->getOperand(1))
- // -smax(-x, -y) == smin(x, y).
- return SE.getNegativeSCEV(SE.getSMaxExpr(
- SE.getNegativeSCEV(getSCEV(LHS)),
- SE.getNegativeSCEV(getSCEV(RHS))));
+ // ~smax(~x, ~y) == smin(x, y).
+ return SE.getNotSCEV(SE.getSMaxExpr(
+ SE.getNotSCEV(getSCEV(LHS)),
+ SE.getNotSCEV(getSCEV(RHS))));
break;
case ICmpInst::ICMP_ULT:
case ICmpInst::ICMP_ULE:
OpenPOWER on IntegriCloud