diff options
| author | Dan Gohman <gohman@apple.com> | 2009-12-18 18:45:31 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-12-18 18:45:31 +0000 |
| commit | 51f13056bdd6a00c9709da61f1183688330eaa1d (patch) | |
| tree | 3abd8ec58412d6d7d27379ba18242f68bd1733b2 /llvm/lib | |
| parent | acde99ea522de504ea917d0a8fb8f31d2831e153 (diff) | |
| download | bcm5719-llvm-51f13056bdd6a00c9709da61f1183688330eaa1d.tar.gz bcm5719-llvm-51f13056bdd6a00c9709da61f1183688330eaa1d.zip | |
Revert this use of NUW/NSW also. Overflow-undefined multiplication isn't
associative either.
llvm-svn: 91701
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 3c937e05cc5..ec901b77ccc 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/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; |

