[llvm] r251142 - [SCEV] Fix stylistic issue in MatchBinaryAddToConst; NFCI
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 23 13:09:58 PDT 2015
Author: sanjoy
Date: Fri Oct 23 15:09:57 2015
New Revision: 251142
URL: http://llvm.org/viewvc/llvm-project?rev=251142&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=251142&r1=251141&r2=251142&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Oct 23 15:09:57 2015
@@ -7191,7 +7191,7 @@ bool ScalarEvolution::isKnownPredicateVi
return false;
OutY = cast<SCEVConstant>(ConstOp)->getValue()->getValue();
- return (FlagsPresent & ExpectedFlags) != 0;
+ return (FlagsPresent & ExpectedFlags) == ExpectedFlags;
};
APInt C;
More information about the llvm-commits
mailing list