[llvm] 7d6e7d5 - [Test] And one more test for PR57247
Max Kazantsev via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 21 23:02:14 PDT 2022
Author: Max Kazantsev
Date: 2022-08-22T13:02:01+07:00
New Revision: 7d6e7d5445bd2f8466d7b3557e2672e5a8d02fea
URL: https://github.com/llvm/llvm-project/commit/7d6e7d5445bd2f8466d7b3557e2672e5a8d02fea
DIFF: https://github.com/llvm/llvm-project/commit/7d6e7d5445bd2f8466d7b3557e2672e5a8d02fea.diff
LOG: [Test] And one more test for PR57247
Added:
Modified:
llvm/test/Transforms/IndVarSimplify/pr57247.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/IndVarSimplify/pr57247.ll b/llvm/test/Transforms/IndVarSimplify/pr57247.ll
index 348d26dccfa1..867856a0f48c 100644
--- a/llvm/test/Transforms/IndVarSimplify/pr57247.ll
+++ b/llvm/test/Transforms/IndVarSimplify/pr57247.ll
@@ -95,3 +95,50 @@ outer.latch: ; preds = %inner.latch
exit: ; preds = %inner.loop
ret i32 %iv
}
+
+define i32 @test_03() {
+; CHECK-LABEL: @test_03(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br label [[OUTER_LOOP:%.*]]
+; CHECK: outer.loop:
+; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 2147483640, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[OUTER_LATCH:%.*]] ]
+; CHECK-NEXT: [[CHECK_1:%.*]] = icmp ult i32 [[IV]], 2147483647
+; CHECK-NEXT: br label [[INNER_LOOP:%.*]]
+; CHECK: inner.loop:
+; CHECK-NEXT: [[STOREMERGE611_I:%.*]] = phi i64 [ 0, [[OUTER_LOOP]] ], [ [[ADD_I:%.*]], [[INNER_LATCH:%.*]] ]
+; CHECK-NEXT: br i1 [[CHECK_1]], label [[INNER_LATCH]], label [[EXIT:%.*]]
+; CHECK: inner.latch:
+; CHECK-NEXT: [[ADD_I]] = add nuw nsw i64 [[STOREMERGE611_I]], 1
+; CHECK-NEXT: [[CMP5_I:%.*]] = icmp ult i64 [[STOREMERGE611_I]], 11
+; CHECK-NEXT: br i1 [[CMP5_I]], label [[INNER_LOOP]], label [[OUTER_LATCH]]
+; CHECK: outer.latch:
+; CHECK-NEXT: [[IV_NEXT]] = add nuw i32 [[IV]], 10
+; CHECK-NEXT: br label [[OUTER_LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: [[IV_LCSSA:%.*]] = phi i32 [ [[IV]], [[INNER_LOOP]] ]
+; CHECK-NEXT: ret i32 [[IV_LCSSA]]
+;
+entry:
+ br label %outer.loop
+
+outer.loop: ; preds = %outer.latch, %entry
+ %iv = phi i32 [ 2147483640, %entry ], [ %iv.next, %outer.latch ]
+ %check_1 = icmp ult i32 %iv, 2147483647
+ br label %inner.loop
+
+inner.loop: ; preds = %inner.latch, %outer.loop
+ %storemerge611.i = phi i64 [ 0, %outer.loop ], [ %add.i, %inner.latch ]
+ br i1 %check_1, label %inner.latch, label %exit
+
+inner.latch: ; preds = %inner.loop
+ %add.i = add i64 %storemerge611.i, 1
+ %cmp5.i = icmp ult i64 %storemerge611.i, 11
+ br i1 %cmp5.i, label %inner.loop, label %outer.latch
+
+outer.latch: ; preds = %inner.latch
+ %iv.next = add i32 %iv, 10
+ br label %outer.loop
+
+exit: ; preds = %inner.loop
+ ret i32 %iv
+}
More information about the llvm-commits
mailing list