[SCEV] Fix stylistic issue in MatchBinaryAddToConst; NFCI

Instead of checking `(FlagsPresent & ExpectedFlags) != 0`, check
`(FlagsPresent & ExpectedFlags) == ExpectedFlags`.  Right now they're
equivalent since `ExpectedFlags` can only be either `FlagNUW` or
`FlagNSW`, but if we ever pass in `ExpectedFlags` as `FlagNUW | FlagNSW`
then checking `(FlagsPresent & ExpectedFlags) != 0` would be wrong.

llvm-svn: 251142
This commit is contained in:
Sanjoy Das 2015-10-23 20:09:57 +00:00
parent 0a1bee8a80
commit 52f7b08b4a
1 changed files with 1 additions and 1 deletions

View File

@ -7191,7 +7191,7 @@ bool ScalarEvolution::isKnownPredicateViaNoOverflow(ICmpInst::Predicate Pred,
return false; return false;
OutY = cast<SCEVConstant>(ConstOp)->getValue()->getValue(); OutY = cast<SCEVConstant>(ConstOp)->getValue()->getValue();
return (FlagsPresent & ExpectedFlags) != 0; return (FlagsPresent & ExpectedFlags) == ExpectedFlags;
}; };
APInt C; APInt C;