forked from OSchip/llvm-project
SCEV: Actually set overflow flags on add expressions.
setFlags doesn't modify its arguments. llvm-svn: 145007
This commit is contained in:
parent
20df3953d3
commit
b5ba2eef2d
|
@ -3601,9 +3601,9 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) {
|
||||||
SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap;
|
SCEV::NoWrapFlags Flags = SCEV::FlagAnyWrap;
|
||||||
OverflowingBinaryOperator *OBO = cast<OverflowingBinaryOperator>(V);
|
OverflowingBinaryOperator *OBO = cast<OverflowingBinaryOperator>(V);
|
||||||
if (OBO->hasNoSignedWrap())
|
if (OBO->hasNoSignedWrap())
|
||||||
setFlags(Flags, SCEV::FlagNSW);
|
Flags = setFlags(Flags, SCEV::FlagNSW);
|
||||||
if (OBO->hasNoUnsignedWrap())
|
if (OBO->hasNoUnsignedWrap())
|
||||||
setFlags(Flags, SCEV::FlagNUW);
|
Flags = setFlags(Flags, SCEV::FlagNUW);
|
||||||
return getAddExpr(AddOps, Flags);
|
return getAddExpr(AddOps, Flags);
|
||||||
}
|
}
|
||||||
case Instruction::Mul: {
|
case Instruction::Mul: {
|
||||||
|
|
Loading…
Reference in New Issue