diff options
author | Justin Lebar <jlebar@google.com> | 2018-06-16 00:13:57 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2018-06-16 00:13:57 +0000 |
commit | 018c3790f9da09c8a86580eee94b38f0fa576a1d (patch) | |
tree | 4153a56b1d264eab5769076102ff3aad94a767f3 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 8e570c3390d208e0fc2a1f6ffc0152f9a322a8d6 (diff) | |
download | bcm5719-llvm-018c3790f9da09c8a86580eee94b38f0fa576a1d.tar.gz bcm5719-llvm-018c3790f9da09c8a86580eee94b38f0fa576a1d.zip |
Revert "[SCEV] Simplify some flags expressions." -- dependent revision breaks MSVC builds.
This reverts D48238.
llvm-svn: 334877
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-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 c60035198f3..a1566cb5e86 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) { + if ((Flags & SCEV::FlagNSW) == 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) + if ((ScevFlags | SCEV::FlagNSW) == ScevFlags) 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) + if ((StaticFlags | SCEV::FlagNSW) == StaticFlags) ImpliedFlags = IncrementNSSW; - if (StaticFlags & SCEV::FlagNUW) { + if ((StaticFlags | SCEV::FlagNUW) == StaticFlags) { // 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))) |