summaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-12-18 18:45:31 +0000
committerDan Gohman <gohman@apple.com>2009-12-18 18:45:31 +0000
commit59de33ef3934eb98f0c5dfbfb2c56fb4b80bda56 (patch)
tree9daf149b5b131e3f658baab918e6808d9de40640 /lib/Analysis/ScalarEvolution.cpp
parentfda60d35c247c239857ebaae8650b06f1154e68e (diff)
downloadllvm-59de33ef3934eb98f0c5dfbfb2c56fb4b80bda56.tar.gz
llvm-59de33ef3934eb98f0c5dfbfb2c56fb4b80bda56.tar.bz2
llvm-59de33ef3934eb98f0c5dfbfb2c56fb4b80bda56.tar.xz
Revert this use of NUW/NSW also. Overflow-undefined multiplication isn't
associative either. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 3c937e05cc..ec901b77cc 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -1460,7 +1460,10 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
AddRec->op_end());
AddRecOps[0] = getAddExpr(LIOps);
+ // It's tempting to propogate NUW/NSW flags here, but nuw/nsw addition
+ // is not associative so this isn't necessarily safe.
const SCEV *NewRec = getAddRecExpr(AddRecOps, AddRec->getLoop());
+
// If all of the other operands were loop invariant, we are done.
if (Ops.size() == 1) return NewRec;
@@ -1636,9 +1639,9 @@ const SCEV *ScalarEvolution::getMulExpr(SmallVectorImpl<const SCEV *> &Ops,
}
}
- const SCEV *NewRec = getAddRecExpr(NewOps, AddRec->getLoop(),
- AddRec->hasNoUnsignedWrap() && HasNUW,
- AddRec->hasNoSignedWrap() && HasNSW);
+ // It's tempting to propogate NUW/NSW flags here, but nuw/nsw multiplication
+ // is not associative so this isn't necessarily safe.
+ const SCEV *NewRec = getAddRecExpr(NewOps, AddRec->getLoop());
// If all of the other operands were loop invariant, we are done.
if (Ops.size() == 1) return NewRec;