Skip to content

Commit 172407a

Browse files
committed
!fixup restore original NUW code
1 parent 6f84e6a commit 172407a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3842,9 +3842,8 @@ const SCEV *ScalarEvolution::getGEPExpr(const SCEV *BaseExpr,
38423842
// Add the base address and the offset. We cannot use the nsw flag, as the
38433843
// base address is unsigned. However, if we know that the offset is
38443844
// non-negative, we can use nuw.
3845-
bool NUW =
3846-
hasFlags(OffsetWrap, SCEV::FlagNUW) ||
3847-
(hasFlags(OffsetWrap, SCEV::FlagNSW) && isKnownNonNegative(Offset));
3845+
bool NUW = NW.hasNoUnsignedWrap() ||
3846+
(NW.hasNoUnsignedSignedWrap() && isKnownNonNegative(Offset));
38483847
SCEV::NoWrapFlags BaseWrap = NUW ? SCEV::FlagNUW : SCEV::FlagAnyWrap;
38493848
auto *GEPExpr = getAddExpr(BaseExpr, Offset, BaseWrap);
38503849
assert(BaseExpr->getType() == GEPExpr->getType() &&

0 commit comments

Comments
 (0)