[llvm] d0b2974 - [indvars] Regenerate a couple of auto-generated test cases [nfc]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 1 10:07:53 PDT 2023
Author: Philip Reames
Date: 2023-11-01T10:07:45-07:00
New Revision: d0b2974e9badf60de180b2b04a42e5870354e14c
URL: https://github.com/llvm/llvm-project/commit/d0b2974e9badf60de180b2b04a42e5870354e14c
DIFF: https://github.com/llvm/llvm-project/commit/d0b2974e9badf60de180b2b04a42e5870354e14c.diff
LOG: [indvars] Regenerate a couple of auto-generated test cases [nfc]
Reducing spurious diff in upcoming changes.
Added:
Modified:
llvm/test/Transforms/IndVarSimplify/AArch64/widen-loop-comp.ll
llvm/test/Transforms/IndVarSimplify/iv-widen-elim-ext.ll
llvm/test/Transforms/IndVarSimplify/pr55925.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/IndVarSimplify/AArch64/widen-loop-comp.ll b/llvm/test/Transforms/IndVarSimplify/AArch64/widen-loop-comp.ll
index 001e7c91e9fc5f1..6f659a88da2e2bf 100644
--- a/llvm/test/Transforms/IndVarSimplify/AArch64/widen-loop-comp.ll
+++ b/llvm/test/Transforms/IndVarSimplify/AArch64/widen-loop-comp.ll
@@ -754,14 +754,14 @@ define i32 @test14a(i32 %start, ptr %p, ptr %q, i1 %c) personality i1 1 {
; CHECK-NEXT: [[LOOP_COND:%.*]] = icmp eq i32 [[STOP]], 0
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nsw i64 [[INDVARS_IV]], -1
; CHECK-NEXT: invoke void @test14a-callee(i1 [[LOOP_COND]])
-; CHECK-NEXT: to label [[LOOP]] unwind label [[EXCEPTION:%.*]]
+; CHECK-NEXT: to label [[LOOP]] unwind label [[EXCEPTION:%.*]]
; CHECK: exit:
; CHECK-NEXT: [[TMP2:%.*]] = trunc i64 -1 to i32
; CHECK-NEXT: ret i32 [[TMP2]]
; CHECK: exception:
; CHECK-NEXT: [[FOO_LCSSA1_WIDE:%.*]] = phi i64 [ [[TMP1]], [[BACKEDGE]] ]
; CHECK-NEXT: [[TMP3:%.*]] = landingpad i1
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: [[TMP4:%.*]] = trunc i64 [[FOO_LCSSA1_WIDE]] to i32
; CHECK-NEXT: ret i32 [[TMP4]]
;
diff --git a/llvm/test/Transforms/IndVarSimplify/iv-widen-elim-ext.ll b/llvm/test/Transforms/IndVarSimplify/iv-widen-elim-ext.ll
index 42649ad73a2ce3d..0e21bf8ba347a80 100644
--- a/llvm/test/Transforms/IndVarSimplify/iv-widen-elim-ext.ll
+++ b/llvm/test/Transforms/IndVarSimplify/iv-widen-elim-ext.ll
@@ -417,6 +417,42 @@ for.body: ; preds = %for.body.lr.ph, %fo
}
define i32 @foo6(ptr %input, i32 %length, ptr %in) {
+; CHECK-LABEL: @foo6(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[STRIDE:%.*]] = getelementptr inbounds [[STRUCT_IMAGE:%.*]], ptr [[INPUT:%.*]], i64 0, i32 1
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[STRIDE]], align 4
+; CHECK-NEXT: [[CMP17:%.*]] = icmp sgt i32 [[LENGTH:%.*]], 1
+; CHECK-NEXT: br i1 [[CMP17]], label [[FOR_BODY_LR_PH:%.*]], label [[FOR_COND_CLEANUP:%.*]]
+; CHECK: for.body.lr.ph:
+; CHECK-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64
+; CHECK-NEXT: [[WIDE_TRIP_COUNT:%.*]] = zext i32 [[LENGTH]] to i64
+; CHECK-NEXT: br label [[FOR_BODY:%.*]]
+; CHECK: for.cond.cleanup.loopexit:
+; CHECK-NEXT: [[TMP2:%.*]] = phi i32 [ [[TMP12:%.*]], [[FOR_BODY]] ]
+; CHECK-NEXT: br label [[FOR_COND_CLEANUP]]
+; CHECK: for.cond.cleanup:
+; CHECK-NEXT: [[TMP3:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[TMP2]], [[FOR_COND_CLEANUP_LOOPEXIT:%.*]] ]
+; CHECK-NEXT: ret i32 [[TMP3]]
+; CHECK: for.body:
+; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[FOR_BODY]] ], [ 1, [[FOR_BODY_LR_PH]] ]
+; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
+; CHECK-NEXT: [[TMP4:%.*]] = and i32 [[LENGTH]], [[TMP0]]
+; CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP4]] to i64
+; CHECK-NEXT: [[TMP6:%.*]] = mul nuw i64 [[TMP5]], [[INDVARS_IV_NEXT]]
+; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[IN:%.*]], i64 [[TMP6]]
+; CHECK-NEXT: [[TMP7:%.*]] = load i32, ptr [[ADD_PTR]], align 4
+; CHECK-NEXT: [[TMP8:%.*]] = mul nuw i64 [[TMP1]], [[INDVARS_IV_NEXT]]
+; CHECK-NEXT: [[ADD_PTR1:%.*]] = getelementptr inbounds i32, ptr [[IN]], i64 [[TMP8]]
+; CHECK-NEXT: [[TMP9:%.*]] = load i32, ptr [[ADD_PTR1]], align 4
+; CHECK-NEXT: [[OR:%.*]] = or i32 [[LENGTH]], [[TMP9]]
+; CHECK-NEXT: [[TMP10:%.*]] = zext i32 [[OR]] to i64
+; CHECK-NEXT: [[TMP11:%.*]] = sub nuw i64 [[TMP10]], [[INDVARS_IV_NEXT]]
+; CHECK-NEXT: [[PTR_OR:%.*]] = getelementptr inbounds i32, ptr [[IN]], i64 [[TMP11]]
+; CHECK-NEXT: [[VAL_OR:%.*]] = load i32, ptr [[PTR_OR]], align 4
+; CHECK-NEXT: [[TMP12]] = add i32 [[TMP7]], [[VAL_OR]]
+; CHECK-NEXT: [[EXITCOND:%.*]] = icmp ne i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
+; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP_LOOPEXIT]]
+;
entry:
%stride = getelementptr inbounds %struct.image, ptr %input, i64 0, i32 1
%0 = load i32, ptr %stride, align 4
@@ -436,12 +472,6 @@ for.cond.cleanup: ; preds = %for.cond.cleanup.lo
; Extend foo4 so that any loop variants (%3 and %or) with mul/sub/add then extend will not
; need a trunc instruction
-; CHECK: for.body:
-; CHECK-NOT: trunc
-; CHECK: [[TMP0:%.*]] = and i32 %length, %0
-; CHECK-NEXT: zext i32 [[TMP0]] to i64
-; CHECK: [[TMP1:%.*]] = or i32 %length, [[TMP2:%.*]]
-; CHECK-NEXT: zext i32 [[TMP1]] to i64
for.body: ; preds = %for.body.lr.ph, %for.body
%x.018 = phi i32 [ 1, %for.body.lr.ph ], [ %add, %for.body ]
%add = add nuw nsw i32 %x.018, 1
diff --git a/llvm/test/Transforms/IndVarSimplify/pr55925.ll b/llvm/test/Transforms/IndVarSimplify/pr55925.ll
index 94ac4bbfdeef70c..376e9440acbf22e 100644
--- a/llvm/test/Transforms/IndVarSimplify/pr55925.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr55925.ll
@@ -16,7 +16,7 @@ define void @test(ptr %p) personality ptr undef {
; CHECK-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[INDVARS_IV_NEXT:%.*]], [[LOOP_LATCH:%.*]] ], [ 0, [[ENTRY:%.*]] ]
; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[IV_NEXT:%.*]], [[LOOP_LATCH]] ]
; CHECK-NEXT: [[RES:%.*]] = invoke i32 @foo(i32 returned [[IV]])
-; CHECK-NEXT: to label [[LOOP_LATCH]] unwind label [[EXIT:%.*]]
+; CHECK-NEXT: to label [[LOOP_LATCH]] unwind label [[EXIT:%.*]]
; CHECK: loop.latch:
; CHECK-NEXT: [[INDVARS_IV_NEXT]] = add i64 [[INDVARS_IV]], 1
; CHECK-NEXT: [[IV_NEXT]] = add nuw i32 [[IV]], 1
@@ -25,7 +25,7 @@ define void @test(ptr %p) personality ptr undef {
; CHECK-NEXT: br label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: [[LP:%.*]] = landingpad { ptr, i32 }
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: ret void
;
entry:
@@ -60,7 +60,7 @@ define void @test_critedge(i1 %c, ptr %p) personality ptr undef {
; CHECK: loop.invoke:
; CHECK-NEXT: [[TMP0:%.*]] = trunc i64 [[INDVARS_IV]] to i32
; CHECK-NEXT: [[RES:%.*]] = invoke i32 @foo(i32 returned [[IV]])
-; CHECK-NEXT: to label [[LOOP_LATCH]] unwind label [[EXIT:%.*]]
+; CHECK-NEXT: to label [[LOOP_LATCH]] unwind label [[EXIT:%.*]]
; CHECK: loop.other:
; CHECK-NEXT: br label [[LOOP_LATCH]]
; CHECK: loop.latch:
@@ -71,7 +71,7 @@ define void @test_critedge(i1 %c, ptr %p) personality ptr undef {
; CHECK-NEXT: br label [[LOOP]]
; CHECK: exit:
; CHECK-NEXT: [[LP:%.*]] = landingpad { ptr, i32 }
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: ret void
;
entry:
More information about the llvm-commits
mailing list