diff options
author | Eric Christopher <echristo@apple.com> | 2011-01-11 09:02:09 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2011-01-11 09:02:09 +0000 |
commit | 87376839a651ed1221dd46762701f13ad6ece0eb (patch) | |
tree | 801646915aabce1b65f5acc35b81c120d08f54ce /lib/Analysis | |
parent | 3077ca97bdd4de7e8878e2f8308b6f615b60a470 (diff) | |
download | external_llvm-87376839a651ed1221dd46762701f13ad6ece0eb.zip external_llvm-87376839a651ed1221dd46762701f13ad6ece0eb.tar.gz external_llvm-87376839a651ed1221dd46762701f13ad6ece0eb.tar.bz2 |
Temporarily revert 123133, it's causing some regressions and I'm trying
to get a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 8deade3..ead4372 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -1560,14 +1560,10 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops, AddRecOps[0] = getAddExpr(LIOps); // Build the new addrec. Propagate the NUW and NSW flags if both the - // outer add and the inner addrec are guaranteed to have no overflow or if - // there is no outer part. - if (Ops.size() != 1) { - HasNUW &= AddRec->hasNoUnsignedWrap(); - HasNSW &= AddRec->hasNoSignedWrap(); - } - - const SCEV *NewRec = getAddRecExpr(AddRecOps, AddRecLoop, HasNUW, HasNSW); + // outer add and the inner addrec are guaranteed to have no overflow. + const SCEV *NewRec = getAddRecExpr(AddRecOps, AddRecLoop, + HasNUW && AddRec->hasNoUnsignedWrap(), + HasNSW && AddRec->hasNoSignedWrap()); // If all of the other operands were loop invariant, we are done. if (Ops.size() == 1) return NewRec; |