llvm.org GIT mirror llvm / 20708f3
Pull r360426 as it is breaking the build bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360437 91177308-0d34-0410-b5e6-96231b3b80d8 Nemanja Ivanovic 4 months ago
1 changed file(s) with 0 addition(s) and 153 deletion(s). Raw diff Collapse all Expand all
+0
-153
test/Transforms/PhaseOrdering/reassociate-after-unroll.ll less more
None ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
1 ; RUN: opt -mtriple=powerpc64le-unknown-unknown -O2 -S < %s | FileCheck %s
2 ; RUN: opt -mtriple=powerpc64le-unknown-unknown -passes='default' -S < %s | FileCheck %s --check-prefix=NPM
3
4 target datalayout = "e-m:e-i64:64-n32:64"
5 target triple = "powerpc64le-unknown-linux-gnu"
6
7 define dso_local i64 @func(i64 %blah, i64 %limit) #0 {
8 ; CHECK-LABEL: @func(
9 ; CHECK-NEXT: entry:
10 ; CHECK-NEXT: [[CMP4:%.*]] = icmp eq i64 [[LIMIT:%.*]], 0
11 ; CHECK-NEXT: br i1 [[CMP4]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_LR_PH:%.*]]
12 ; CHECK: for.body.lr.ph:
13 ; CHECK-NEXT: [[CONV:%.*]] = and i64 [[BLAH:%.*]], 4294967295
14 ; CHECK-NEXT: [[TMP0:%.*]] = add i64 [[LIMIT]], -1
15 ; CHECK-NEXT: [[XTRAITER:%.*]] = and i64 [[LIMIT]], 7
16 ; CHECK-NEXT: [[TMP1:%.*]] = icmp ult i64 [[TMP0]], 7
17 ; CHECK-NEXT: br i1 [[TMP1]], label [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA:%.*]], label [[FOR_BODY_LR_PH_NEW:%.*]]
18 ; CHECK: for.body.lr.ph.new:
19 ; CHECK-NEXT: [[UNROLL_ITER:%.*]] = sub i64 [[LIMIT]], [[XTRAITER]]
20 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
21 ; CHECK: for.cond.cleanup.loopexit.unr-lcssa:
22 ; CHECK-NEXT: [[ADD_LCSSA_PH:%.*]] = phi i64 [ undef, [[FOR_BODY_LR_PH]] ], [ [[ADD_7:%.*]], [[FOR_BODY]] ]
23 ; CHECK-NEXT: [[K_05_UNR:%.*]] = phi i64 [ 1, [[FOR_BODY_LR_PH]] ], [ [[AND:%.*]], [[FOR_BODY]] ]
24 ; CHECK-NEXT: [[LCMP_MOD:%.*]] = icmp eq i64 [[XTRAITER]], 0
25 ; CHECK-NEXT: br i1 [[LCMP_MOD]], label [[FOR_COND_CLEANUP]], label [[FOR_BODY_EPIL:%.*]]
26 ; CHECK: for.body.epil:
27 ; CHECK-NEXT: [[G_06_EPIL:%.*]] = phi i64 [ [[ADD_EPIL:%.*]], [[FOR_BODY_EPIL]] ], [ [[ADD_LCSSA_PH]], [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]] ]
28 ; CHECK-NEXT: [[K_05_EPIL:%.*]] = phi i64 [ [[AND_EPIL:%.*]], [[FOR_BODY_EPIL]] ], [ [[K_05_UNR]], [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]] ]
29 ; CHECK-NEXT: [[EPIL_ITER:%.*]] = phi i64 [ [[EPIL_ITER_SUB:%.*]], [[FOR_BODY_EPIL]] ], [ [[XTRAITER]], [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]] ]
30 ; CHECK-NEXT: [[AND_EPIL]] = and i64 [[CONV]], [[K_05_EPIL]]
31 ; CHECK-NEXT: [[ADD_EPIL]] = add i64 [[AND_EPIL]], [[G_06_EPIL]]
32 ; CHECK-NEXT: [[EPIL_ITER_SUB]] = add i64 [[EPIL_ITER]], -1
33 ; CHECK-NEXT: [[EPIL_ITER_CMP:%.*]] = icmp eq i64 [[EPIL_ITER_SUB]], 0
34 ; CHECK-NEXT: br i1 [[EPIL_ITER_CMP]], label [[FOR_COND_CLEANUP]], label [[FOR_BODY_EPIL]], !llvm.loop !0
35 ; CHECK: for.cond.cleanup:
36 ; CHECK-NEXT: [[G_0_LCSSA:%.*]] = phi i64 [ undef, [[ENTRY:%.*]] ], [ [[ADD_LCSSA_PH]], [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]] ], [ [[ADD_EPIL]], [[FOR_BODY_EPIL]] ]
37 ; CHECK-NEXT: ret i64 [[G_0_LCSSA]]
38 ; CHECK: for.body:
39 ; CHECK-NEXT: [[G_06:%.*]] = phi i64 [ undef, [[FOR_BODY_LR_PH_NEW]] ], [ [[ADD_7]], [[FOR_BODY]] ]
40 ; CHECK-NEXT: [[K_05:%.*]] = phi i64 [ 1, [[FOR_BODY_LR_PH_NEW]] ], [ [[AND]], [[FOR_BODY]] ]
41 ; CHECK-NEXT: [[NITER:%.*]] = phi i64 [ [[UNROLL_ITER]], [[FOR_BODY_LR_PH_NEW]] ], [ [[NITER_NSUB_7:%.*]], [[FOR_BODY]] ]
42 ; CHECK-NEXT: [[AND]] = and i64 [[CONV]], [[K_05]]
43 ; CHECK-NEXT: [[ADD:%.*]] = add i64 [[AND]], [[G_06]]
44 ; CHECK-NEXT: [[ADD_1:%.*]] = add i64 [[AND]], [[ADD]]
45 ; CHECK-NEXT: [[ADD_2:%.*]] = add i64 [[AND]], [[ADD_1]]
46 ; CHECK-NEXT: [[ADD_3:%.*]] = add i64 [[AND]], [[ADD_2]]
47 ; CHECK-NEXT: [[ADD_4:%.*]] = add i64 [[AND]], [[ADD_3]]
48 ; CHECK-NEXT: [[ADD_5:%.*]] = add i64 [[AND]], [[ADD_4]]
49 ; CHECK-NEXT: [[ADD_6:%.*]] = add i64 [[AND]], [[ADD_5]]
50 ; CHECK-NEXT: [[ADD_7]] = add i64 [[AND]], [[ADD_6]]
51 ; CHECK-NEXT: [[NITER_NSUB_7]] = add i64 [[NITER]], -8
52 ; CHECK-NEXT: [[NITER_NCMP_7:%.*]] = icmp eq i64 [[NITER_NSUB_7]], 0
53 ; CHECK-NEXT: br i1 [[NITER_NCMP_7]], label [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]], label [[FOR_BODY]]
54 ;
55 ; NPM-LABEL: @func(
56 ; NPM-NEXT: entry:
57 ; NPM-NEXT: [[CMP4:%.*]] = icmp eq i64 [[LIMIT:%.*]], 0
58 ; NPM-NEXT: br i1 [[CMP4]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_LR_PH:%.*]]
59 ; NPM: for.body.lr.ph:
60 ; NPM-NEXT: [[CONV:%.*]] = and i64 [[BLAH:%.*]], 4294967295
61 ; NPM-NEXT: [[TMP0:%.*]] = add i64 [[LIMIT]], -1
62 ; NPM-NEXT: [[XTRAITER:%.*]] = and i64 [[LIMIT]], 7
63 ; NPM-NEXT: [[TMP1:%.*]] = icmp ult i64 [[TMP0]], 7
64 ; NPM-NEXT: br i1 [[TMP1]], label [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA:%.*]], label [[FOR_BODY_LR_PH_NEW:%.*]]
65 ; NPM: for.body.lr.ph.new:
66 ; NPM-NEXT: [[UNROLL_ITER:%.*]] = sub i64 [[LIMIT]], [[XTRAITER]]
67 ; NPM-NEXT: [[AND_0:%.*]] = and i64 [[CONV]], 1
68 ; NPM-NEXT: br label [[FOR_BODY:%.*]]
69 ; NPM: for.cond.cleanup.loopexit.unr-lcssa:
70 ; NPM-NEXT: [[ADD_LCSSA_PH:%.*]] = phi i64 [ undef, [[FOR_BODY_LR_PH]] ], [ [[ADD_7:%.*]], [[FOR_BODY]] ]
71 ; NPM-NEXT: [[K_05_UNR:%.*]] = phi i64 [ 1, [[FOR_BODY_LR_PH]] ], [ [[AND_PHI:%.*]], [[FOR_BODY]] ]
72 ; NPM-NEXT: [[LCMP_MOD:%.*]] = icmp eq i64 [[XTRAITER]], 0
73 ; NPM-NEXT: br i1 [[LCMP_MOD]], label [[FOR_COND_CLEANUP]], label [[FOR_BODY_EPIL:%.*]]
74 ; NPM: for.body.epil:
75 ; NPM-NEXT: [[G_06_EPIL:%.*]] = phi i64 [ [[ADD_EPIL:%.*]], [[FOR_BODY_EPIL]] ], [ [[ADD_LCSSA_PH]], [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]] ]
76 ; NPM-NEXT: [[K_05_EPIL:%.*]] = phi i64 [ [[AND_EPIL:%.*]], [[FOR_BODY_EPIL]] ], [ [[K_05_UNR]], [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]] ]
77 ; NPM-NEXT: [[EPIL_ITER:%.*]] = phi i64 [ [[EPIL_ITER_SUB:%.*]], [[FOR_BODY_EPIL]] ], [ [[XTRAITER]], [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]] ]
78 ; NPM-NEXT: [[AND_EPIL]] = and i64 [[CONV]], [[K_05_EPIL]]
79 ; NPM-NEXT: [[ADD_EPIL]] = add i64 [[AND_EPIL]], [[G_06_EPIL]]
80 ; NPM-NEXT: [[EPIL_ITER_SUB]] = add i64 [[EPIL_ITER]], -1
81 ; NPM-NEXT: [[EPIL_ITER_CMP:%.*]] = icmp eq i64 [[EPIL_ITER_SUB]], 0
82 ; NPM-NEXT: br i1 [[EPIL_ITER_CMP]], label [[FOR_COND_CLEANUP]], label [[FOR_BODY_EPIL]], !llvm.loop !0
83 ; NPM: for.cond.cleanup:
84 ; NPM-NEXT: [[G_0_LCSSA:%.*]] = phi i64 [ undef, [[ENTRY:%.*]] ], [ [[ADD_LCSSA_PH]], [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]] ], [ [[ADD_EPIL]], [[FOR_BODY_EPIL]] ]
85 ; NPM-NEXT: ret i64 [[G_0_LCSSA]]
86 ; NPM: for.body:
87 ; NPM-NEXT: [[G_06:%.*]] = phi i64 [ undef, [[FOR_BODY_LR_PH_NEW]] ], [ [[ADD_7]], [[FOR_BODY_FOR_BODY_CRIT_EDGE:%.*]] ]
88 ; NPM-NEXT: [[AND_PHI]] = phi i64 [ [[AND_0]], [[FOR_BODY_LR_PH_NEW]] ], [ [[AND_1:%.*]], [[FOR_BODY_FOR_BODY_CRIT_EDGE]] ]
89 ; NPM-NEXT: [[NITER:%.*]] = phi i64 [ [[UNROLL_ITER]], [[FOR_BODY_LR_PH_NEW]] ], [ [[NITER_NSUB_7:%.*]], [[FOR_BODY_FOR_BODY_CRIT_EDGE]] ]
90 ; NPM-NEXT: [[ADD:%.*]] = add i64 [[AND_PHI]], [[G_06]]
91 ; NPM-NEXT: [[ADD_1:%.*]] = add i64 [[AND_PHI]], [[ADD]]
92 ; NPM-NEXT: [[ADD_2:%.*]] = add i64 [[AND_PHI]], [[ADD_1]]
93 ; NPM-NEXT: [[ADD_3:%.*]] = add i64 [[AND_PHI]], [[ADD_2]]
94 ; NPM-NEXT: [[ADD_4:%.*]] = add i64 [[AND_PHI]], [[ADD_3]]
95 ; NPM-NEXT: [[ADD_5:%.*]] = add i64 [[AND_PHI]], [[ADD_4]]
96 ; NPM-NEXT: [[ADD_6:%.*]] = add i64 [[AND_PHI]], [[ADD_5]]
97 ; NPM-NEXT: [[ADD_7]] = add i64 [[AND_PHI]], [[ADD_6]]
98 ; NPM-NEXT: [[NITER_NSUB_7]] = add i64 [[NITER]], -8
99 ; NPM-NEXT: [[NITER_NCMP_7:%.*]] = icmp eq i64 [[NITER_NSUB_7]], 0
100 ; NPM-NEXT: br i1 [[NITER_NCMP_7]], label [[FOR_COND_CLEANUP_LOOPEXIT_UNR_LCSSA]], label [[FOR_BODY_FOR_BODY_CRIT_EDGE]]
101 ; NPM: for.body.for.body_crit_edge:
102 ; NPM-NEXT: [[AND_1]] = and i64 [[CONV]], [[AND_PHI]]
103 ; NPM-NEXT: br label [[FOR_BODY]]
104 ;
105 entry:
106 %blah.addr = alloca i64, align 8
107 %limit.addr = alloca i64, align 8
108 %k = alloca i32, align 4
109 %g = alloca i64, align 8
110 %i = alloca i64, align 8
111 store i64 %blah, i64* %blah.addr, align 8
112 store i64 %limit, i64* %limit.addr, align 8
113 store i32 1, i32* %k, align 4
114 store i64 0, i64* %i, align 8
115 br label %for.cond
116
117 for.cond: ; preds = %for.body, %entry
118 %0 = load i64, i64* %i, align 8
119 %1 = load i64, i64* %limit.addr, align 8
120 %cmp = icmp ult i64 %0, %1
121 br i1 %cmp, label %for.body, label %for.cond.cleanup
122
123 for.cond.cleanup: ; preds = %for.cond
124 %2 = load i64, i64* %g, align 8
125 ret i64 %2
126
127 for.body: ; preds = %for.cond
128 %3 = load i64, i64* %blah.addr, align 8
129 %4 = load i32, i32* %k, align 4
130 %conv = zext i32 %4 to i64
131 %and = and i64 %conv, %3
132 %conv1 = trunc i64 %and to i32
133 store i32 %conv1, i32* %k, align 4
134 %5 = load i32, i32* %k, align 4
135 %conv2 = zext i32 %5 to i64
136 %6 = load i64, i64* %g, align 8
137 %add = add i64 %6, %conv2
138 store i64 %add, i64* %g, align 8
139 %7 = load i64, i64* %i, align 8
140 %inc = add i64 %7, 1
141 store i64 %inc, i64* %i, align 8
142 br label %for.cond
143 }
144
145 ; Function Attrs: argmemonly nounwind
146 declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1
147
148 ; Function Attrs: argmemonly nounwind
149 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1
150
151 attributes #0 = { "use-soft-float"="false" }
152 attributes #1 = { argmemonly nounwind }