SCEV: Actually set overflow flags on add expressions.

setFlags doesn't modify its arguments.

llvm-svn: 145007
This commit is contained in:
Benjamin Kramer 2011-11-20 10:24:36 +00:00
parent 20df3953d3
commit b5ba2eef2d
1 changed files with 2 additions and 2 deletions

View File

@ -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: {