Skip to content

Commit e834442

Browse files
committed
!fixup pass FlagAnyWrap.
1 parent c37ee78 commit e834442

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,9 +2691,9 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
26912691
if (isa<SCEVAddExpr>(B) &&
26922692
NarrowA == getNegativeSCEV(cast<SCEVAddExpr>(B)->getOperand(0)) &&
26932693
getZeroExtendExpr(NarrowA, ZExt->getType()) == A &&
2694-
hasFlags(
2695-
StrengthenNoWrapFlags(this, scAddExpr, {NarrowA, B}, OrigFlags),
2696-
SCEV::FlagNUW)) {
2694+
hasFlags(StrengthenNoWrapFlags(this, scAddExpr, {NarrowA, B},
2695+
SCEV::FlagAnyWrap),
2696+
SCEV::FlagNUW)) {
26972697
return getZeroExtendExpr(getAddExpr(NarrowA, B), ZExt->getType());
26982698
}
26992699
}

llvm/test/Analysis/ScalarEvolution/zext-add.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ define void @test_push_constant_into_zext(ptr %dst, ptr %src, i32 %n, i64 %offse
1717
; CHECK-NEXT: %l = load i8, ptr %outer.ptr, align 1
1818
; CHECK-NEXT: --> %l U: full-set S: full-set Exits: <<Unknown>> LoopDispositions: { %inner.loop: Variant, %outer.loop: Variant }
1919
; CHECK-NEXT: %ptr.iv.next = getelementptr i8, ptr %ptr.iv, i64 %offset
20-
; CHECK-NEXT: --> {(%offset + %src),+,%offset}<%inner.loop> U: full-set S: full-set Exits: (((1 + (zext i32 (-1 + (1 smax %n))<nsw> to i64))<nuw><nsw> * %offset) + %src) LoopDispositions: { %inner.loop: Computable, %outer.loop: Variant }
20+
; CHECK-NEXT: --> {(%offset + %src),+,%offset}<%inner.loop> U: full-set S: full-set Exits: (((zext i32 (1 smax %n) to i64) * %offset) + %src) LoopDispositions: { %inner.loop: Computable, %outer.loop: Variant }
2121
; CHECK-NEXT: %iv.next = add i32 %iv, 1
2222
; CHECK-NEXT: --> {1,+,1}<nuw><nsw><%inner.loop> U: [1,-2147483648) S: [1,-2147483648) Exits: (1 smax %n) LoopDispositions: { %inner.loop: Computable, %outer.loop: Variant }
2323
; CHECK-NEXT: Determining loop execution counts for: @test_push_constant_into_zext

0 commit comments

Comments
 (0)