[llvm] ada219b - [NFC][IndVars] Add test that caused D108043 to be reverted
Roman Lebedev via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 30 02:12:08 PDT 2021
Author: Roman Lebedev
Date: 2021-08-30T12:06:58+03:00
New Revision: ada219b13a2debc94cb252feb0dd987ef9290126
URL: https://github.com/llvm/llvm-project/commit/ada219b13a2debc94cb252feb0dd987ef9290126
DIFF: https://github.com/llvm/llvm-project/commit/ada219b13a2debc94cb252feb0dd987ef9290126.diff
LOG: [NFC][IndVars] Add test that caused D108043 to be reverted
We currently don't simplify anything here, but we can.
Added:
llvm/test/Transforms/IndVarSimplify/D108043.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/Transforms/IndVarSimplify/D108043.ll b/llvm/test/Transforms/IndVarSimplify/D108043.ll
new file mode 100644
index 0000000000000..d12506b1701b5
--- /dev/null
+++ b/llvm/test/Transforms/IndVarSimplify/D108043.ll
@@ -0,0 +1,68 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -indvars -S %s | FileCheck %s
+
+ at g_2168 = external global [4 x [6 x i32]], align 16
+ at g_1150 = external global i32*, align 8
+
+define internal fastcc void @func_2() unnamed_addr {
+; CHECK-LABEL: @func_2(
+; CHECK-NEXT: lbl_2898.preheader:
+; CHECK-NEXT: br label [[LBL_2898:%.*]]
+; CHECK: lbl_2898.loopexit:
+; CHECK-NEXT: [[DOTLCSSA:%.*]] = phi i32* [ [[TMP0:%.*]], [[FOR_COND884:%.*]] ]
+; CHECK-NEXT: store i32* [[DOTLCSSA]], i32** @g_1150, align 8
+; CHECK-NEXT: br label [[LBL_2898]]
+; CHECK: lbl_2898:
+; CHECK-NEXT: [[G_1150_PROMOTED:%.*]] = load i32*, i32** @g_1150, align 8
+; CHECK-NEXT: br label [[FOR_COND884]]
+; CHECK: for.cond884:
+; CHECK-NEXT: [[TMP0]] = phi i32* [ getelementptr inbounds ([4 x [6 x i32]], [4 x [6 x i32]]* @g_2168, i64 0, i64 3, i64 1), [[FOR_END987:%.*]] ], [ [[G_1150_PROMOTED]], [[LBL_2898]] ]
+; CHECK-NEXT: [[STOREMERGE9:%.*]] = phi i16 [ [[ADD990:%.*]], [[FOR_END987]] ], [ 0, [[LBL_2898]] ]
+; CHECK-NEXT: [[CMP886:%.*]] = icmp ult i16 [[STOREMERGE9]], 3
+; CHECK-NEXT: br i1 [[CMP886]], label [[FOR_BODY888:%.*]], label [[LBL_2898_LOOPEXIT:%.*]]
+; CHECK: for.body888:
+; CHECK-NEXT: br label [[FOR_COND918:%.*]]
+; CHECK: for.cond918:
+; CHECK-NEXT: br label [[FOR_END926:%.*]]
+; CHECK: for.end926:
+; CHECK-NEXT: br label [[FOR_COND936:%.*]]
+; CHECK: for.cond936:
+; CHECK-NEXT: br label [[FOR_END987]]
+; CHECK: for.end987:
+; CHECK-NEXT: [[ADD990]] = add nuw nsw i16 [[STOREMERGE9]], 1
+; CHECK-NEXT: br label [[FOR_COND884]]
+;
+lbl_2898.preheader:
+ br label %lbl_2898
+
+lbl_2898.loopexit:
+ %.lcssa = phi i32* [ %0, %for.cond884 ]
+ store i32* %.lcssa, i32** @g_1150, align 8
+ br label %lbl_2898
+
+lbl_2898:
+ %g_1150.promoted = load i32*, i32** @g_1150, align 8
+ br label %for.cond884
+
+for.cond884:
+ %0 = phi i32* [ getelementptr inbounds ([4 x [6 x i32]], [4 x [6 x i32]]* @g_2168, i64 0, i64 3, i64 1), %for.end987 ], [ %g_1150.promoted, %lbl_2898 ]
+ %storemerge9 = phi i16 [ %add990, %for.end987 ], [ 0, %lbl_2898 ]
+ %cmp886 = icmp slt i16 %storemerge9, 3
+ br i1 %cmp886, label %for.body888, label %lbl_2898.loopexit
+
+for.body888:
+ br label %for.cond918
+
+for.cond918:
+ br label %for.end926
+
+for.end926:
+ br label %for.cond936
+
+for.cond936:
+ br label %for.end987
+
+for.end987:
+ %add990 = add i16 %storemerge9, 1
+ br label %for.cond884
+}
More information about the llvm-commits
mailing list