[llvm] r334877 - Revert "[SCEV] Simplify some flags expressions." -- dependent revision breaks MSVC builds.
Justin Lebar via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 15 17:13:58 PDT 2018
Author: jlebar
Date: Fri Jun 15 17:13:57 2018
New Revision: 334877
URL: http://llvm.org/viewvc/llvm-project?rev=334877&view=rev
Log:
Revert "[SCEV] Simplify some flags expressions." -- dependent revision breaks MSVC builds.
This reverts D48238.
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=334877&r1=334876&r2=334877&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Jun 15 17:13:57 2018
@@ -3897,7 +3897,7 @@ const SCEV *ScalarEvolution::getMinusSCE
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() c
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
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)))
More information about the llvm-commits
mailing list