[llvm] 523c572 - [IndVars] Add a new test affected by 62f86d4f
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 17 13:49:22 PDT 2022
Author: Eli Friedman
Date: 2022-03-17T13:49:07-07:00
New Revision: 523c572c376a8998747cf81d16dce8aee69127e5
URL: https://github.com/llvm/llvm-project/commit/523c572c376a8998747cf81d16dce8aee69127e5
DIFF: https://github.com/llvm/llvm-project/commit/523c572c376a8998747cf81d16dce8aee69127e5.diff
LOG: [IndVars] Add a new test affected by 62f86d4f
Added:
Modified:
llvm/test/Transforms/IndVarSimplify/AArch64/widen-loop-comp.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 75b0825bbec0f..de4e996ff131e 100644
--- a/llvm/test/Transforms/IndVarSimplify/AArch64/widen-loop-comp.ll
+++ b/llvm/test/Transforms/IndVarSimplify/AArch64/widen-loop-comp.ll
@@ -1439,3 +1439,40 @@ loop: ; preds = %loop, %entry
exit: ; preds = %loop
ret void
}
+
+define void @test22(i16* %ptr) {
+; CHECK-LABEL: @test22(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: store i16 0, i16* [[PTR:%.*]], align 4
+; CHECK-NEXT: br label [[LOOP:%.*]]
+; CHECK: loop:
+; CHECK-NEXT: [[IV:%.*]] = phi i32 [ [[IV_NEXT:%.*]], [[LOOP]] ], [ 0, [[ENTRY:%.*]] ]
+; CHECK-NEXT: [[INDVARS:%.*]] = trunc i32 [[IV]] to i16
+; CHECK-NEXT: [[VAL_INC:%.*]] = add i16 [[INDVARS]], 1
+; CHECK-NEXT: store i16 [[VAL_INC]], i16* [[PTR]], align 4
+; CHECK-NEXT: [[IV_WIDE:%.*]] = zext i32 [[IV]] to i64
+; CHECK-NEXT: call void @foo(i64 [[IV_WIDE]])
+; CHECK-NEXT: [[IV_NEXT]] = zext i16 [[VAL_INC]] to i32
+; CHECK-NEXT: [[LOOP_COND:%.*]] = icmp eq i32 [[IV]], 1000
+; CHECK-NEXT: br i1 [[LOOP_COND]], label [[EXIT:%.*]], label [[LOOP]]
+; CHECK: exit:
+; CHECK-NEXT: ret void
+;
+entry:
+ store i16 0, i16* %ptr, align 4
+ br label %loop
+
+loop: ; preds = %loop, %entry
+ %val = phi i16 [ %val.inc, %loop ], [ 0, %entry ]
+ %iv = phi i32 [ %iv.next, %loop ], [ 0, %entry ]
+ %val.inc = add i16 %val, 1
+ store i16 %val.inc, i16* %ptr, align 4
+ %iv.wide = zext i32 %iv to i64
+ call void @foo(i64 %iv.wide)
+ %iv.next = zext i16 %val.inc to i32
+ %loop.cond = icmp eq i32 %iv, 1000
+ br i1 %loop.cond, label %exit, label %loop
+
+exit: ; preds = %loop
+ ret void
+}
More information about the llvm-commits
mailing list