diff options
author | Justin Lebar <jlebar@google.com> | 2018-06-15 23:52:11 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2018-06-15 23:52:11 +0000 |
commit | af30bb1c90b052fbb0e4bbff32471e505e2d9c18 (patch) | |
tree | f1554e43973aba89758fabb0ad3671356b0d5d29 /llvm/lib/Analysis | |
parent | 6cb702d00dbec2bc2f58870d3ee40c8564d89832 (diff) | |
download | bcm5719-llvm-af30bb1c90b052fbb0e4bbff32471e505e2d9c18.tar.gz bcm5719-llvm-af30bb1c90b052fbb0e4bbff32471e505e2d9c18.zip |
[SCEV] Simplify some flags expressions.
Summary:
Sending for presubmit review out of an abundance of caution; it would be
bad to mess this up.
Reviewers: sanjoy
Subscribers: hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D48238
llvm-svn: 334875
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index a1566cb5e86..c60035198f3 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -3897,7 +3897,7 @@ const SCEV *ScalarEvolution::getMinusSCEV(const SCEV *LHS, const SCEV *RHS, auto AddFlags = SCEV::FlagAnyWrap; const bool RHSIsNotMinSigned = !getSignedRangeMin(RHS).isMinSignedValue(); - if ((Flags & SCEV::FlagNSW) == SCEV::FlagNSW) { + if (Flags & SCEV::FlagNSW) { // Let M be the minimum representable signed value. Then (-1)*RHS // signed-wraps if and only if RHS is M. That can happen even for // a NSW subtraction because e.g. (-1)*M signed-wraps even though @@ -11940,7 +11940,7 @@ bool SCEVWrapPredicate::isAlwaysTrue() const { SCEV::NoWrapFlags ScevFlags = AR->getNoWrapFlags(); IncrementWrapFlags IFlags = Flags; - if ((ScevFlags | SCEV::FlagNSW) == ScevFlags) + if (ScevFlags & SCEV::FlagNSW) IFlags &= ~IncrementNSSW; return IFlags == IncrementAnyWrap; @@ -11962,10 +11962,10 @@ SCEVWrapPredicate::getImpliedFlags(const SCEVAddRecExpr *AR, SCEV::NoWrapFlags StaticFlags = AR->getNoWrapFlags(); // We can safely transfer the NSW flag as NSSW. - if ((StaticFlags | SCEV::FlagNSW) == StaticFlags) + if (StaticFlags & SCEV::FlagNSW) ImpliedFlags = IncrementNSSW; - if ((StaticFlags | SCEV::FlagNUW) == StaticFlags) { + if (StaticFlags & SCEV::FlagNUW) { // If the increment is positive, the SCEV NUW flag will also imply the // WrapPredicate NUSW flag. if (const auto *Step = dyn_cast<SCEVConstant>(AR->getStepRecurrence(SE))) |