forked from OSchip/llvm-project
Revert this use of NSW; this one isn't actually safe. NSW addition
is not reassociative. llvm-svn: 91667
This commit is contained in:
parent
57e808628c
commit
7a2dab8826
|
@ -1457,12 +1457,10 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
|
|||
LIOps.push_back(AddRec->getStart());
|
||||
|
||||
SmallVector<const SCEV *, 4> AddRecOps(AddRec->op_begin(),
|
||||
AddRec->op_end());
|
||||
AddRec->op_end());
|
||||
AddRecOps[0] = getAddExpr(LIOps);
|
||||
|
||||
const SCEV *NewRec = getAddRecExpr(AddRecOps, AddRec->getLoop(),
|
||||
AddRec->hasNoUnsignedWrap() && HasNUW,
|
||||
AddRec->hasNoSignedWrap() && HasNSW);
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue