diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-07-30 04:36:32 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-07-30 04:36:32 +0000 |
commit | 1fbffe0cef92ee284f44cfef3ce0db7ec7d86f18 (patch) | |
tree | 82b806bd65764d77de7439d195f9c321aa6f731b /lib/Analysis/ScalarEvolution.cpp | |
parent | 9382b9310f008a3347e565d76aadda6a97351de9 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54194 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 14c1389b43..bf6bc0b5dc 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/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: |