1 ; RUN: opt < %s -loop-reduce
2 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
3 target triple = "aarch64-unknown-linux-gnu"
5 @d = internal unnamed_addr global ptr null, align 8
7 define dso_local i32 @main() local_unnamed_addr {
9 %.pre.pre = load ptr, ptr @d, align 8
12 for.body9: ; preds = %for.body9, %entry
13 %i = phi ptr [ %.pre.pre, %entry ], [ %incdec.ptr, %for.body9 ]
14 %incdec.ptr = getelementptr inbounds ptr, ptr %i, i64 -1
15 br i1 undef, label %for.body9, label %for.inc
17 for.inc: ; preds = %for.body9
18 br label %for.body9.118
20 for.body9.1: ; preds = %for.inc.547, %for.body9.1
21 %i1 = phi ptr [ %incdec.ptr.1, %for.body9.1 ], [ %incdec.ptr.542, %for.inc.547 ]
22 %incdec.ptr.1 = getelementptr inbounds ptr, ptr %i1, i64 -1
23 br i1 undef, label %for.body9.1, label %for.inc.1
25 for.inc.1: ; preds = %for.body9.1
26 br label %for.body9.1.1
28 for.body9.2: ; preds = %for.inc.1.5, %for.body9.2
29 %i2 = phi ptr [ %incdec.ptr.2, %for.body9.2 ], [ %incdec.ptr.1.5, %for.inc.1.5 ]
30 %incdec.ptr.2 = getelementptr inbounds ptr, ptr %i2, i64 -1
31 br i1 undef, label %for.body9.2, label %for.inc.2
33 for.inc.2: ; preds = %for.body9.2
34 br label %for.body9.2.1
36 for.body9.3: ; preds = %for.inc.2.5, %for.body9.3
37 %i3 = phi ptr [ %incdec.ptr.3, %for.body9.3 ], [ %incdec.ptr.2.5, %for.inc.2.5 ]
38 %incdec.ptr.3 = getelementptr inbounds ptr, ptr %i3, i64 -1
39 br i1 undef, label %for.body9.3, label %for.inc.3
41 for.inc.3: ; preds = %for.body9.3
42 br label %for.body9.3.1
44 for.body9.4: ; preds = %for.inc.3.5, %for.body9.4
45 %i4 = phi ptr [ %incdec.ptr.4, %for.body9.4 ], [ %incdec.ptr.3.5, %for.inc.3.5 ]
46 %incdec.ptr.4 = getelementptr inbounds ptr, ptr %i4, i64 -1
47 br i1 undef, label %for.body9.4, label %for.inc.4
49 for.inc.4: ; preds = %for.body9.4
50 br label %for.body9.4.1
52 for.body9.5: ; preds = %for.inc.4.5, %for.body9.5
53 %i5 = phi ptr [ %incdec.ptr.5, %for.body9.5 ], [ %incdec.ptr.4.5, %for.inc.4.5 ]
54 %incdec.ptr.5 = getelementptr inbounds ptr, ptr %i5, i64 -1
55 br i1 undef, label %for.body9.5, label %for.inc.5
57 for.inc.5: ; preds = %for.body9.5
58 br label %for.body9.5.1
60 for.body9.5.1: ; preds = %for.body9.5.1, %for.inc.5
61 %i6 = phi ptr [ %incdec.ptr.5.1, %for.body9.5.1 ], [ %incdec.ptr.5, %for.inc.5 ]
62 %incdec.ptr.5.1 = getelementptr inbounds ptr, ptr %i6, i64 -1
63 br i1 undef, label %for.body9.5.1, label %for.inc.5.1
65 for.inc.5.1: ; preds = %for.body9.5.1
66 br label %for.body9.5.2
68 for.body9.5.2: ; preds = %for.body9.5.2, %for.inc.5.1
69 %i7 = phi ptr [ %incdec.ptr.5.2, %for.body9.5.2 ], [ %incdec.ptr.5.1, %for.inc.5.1 ]
70 %incdec.ptr.5.2 = getelementptr inbounds ptr, ptr %i7, i64 -1
71 br i1 undef, label %for.body9.5.2, label %for.inc.5.2
73 for.inc.5.2: ; preds = %for.body9.5.2
74 br label %for.body9.5.3
76 for.body9.5.3: ; preds = %for.body9.5.3, %for.inc.5.2
77 %i8 = phi ptr [ %incdec.ptr.5.3, %for.body9.5.3 ], [ %incdec.ptr.5.2, %for.inc.5.2 ]
78 %incdec.ptr.5.3 = getelementptr inbounds ptr, ptr %i8, i64 -1
79 br i1 undef, label %for.body9.5.3, label %for.inc.5.3
81 for.inc.5.3: ; preds = %for.body9.5.3
82 br label %for.body9.5.4
84 for.body9.5.4: ; preds = %for.body9.5.4, %for.inc.5.3
85 %i9 = phi ptr [ %incdec.ptr.5.4, %for.body9.5.4 ], [ %incdec.ptr.5.3, %for.inc.5.3 ]
86 %incdec.ptr.5.4 = getelementptr inbounds ptr, ptr %i9, i64 -1
87 br i1 undef, label %for.body9.5.4, label %for.inc.5.4
89 for.inc.5.4: ; preds = %for.body9.5.4
90 br label %for.body9.5.5
92 for.body9.5.5: ; preds = %for.body9.5.5, %for.inc.5.4
93 %i10 = phi ptr [ undef, %for.body9.5.5 ], [ %incdec.ptr.5.4, %for.inc.5.4 ]
94 %i12 = load i64, ptr %i10, align 8
95 br label %for.body9.5.5
97 for.body9.4.1: ; preds = %for.body9.4.1, %for.inc.4
98 %i13 = phi ptr [ %incdec.ptr.4.1, %for.body9.4.1 ], [ %incdec.ptr.4, %for.inc.4 ]
99 %incdec.ptr.4.1 = getelementptr inbounds ptr, ptr %i13, i64 -1
100 br i1 undef, label %for.body9.4.1, label %for.inc.4.1
102 for.inc.4.1: ; preds = %for.body9.4.1
103 br label %for.body9.4.2
105 for.body9.4.2: ; preds = %for.body9.4.2, %for.inc.4.1
106 %i14 = phi ptr [ %incdec.ptr.4.2, %for.body9.4.2 ], [ %incdec.ptr.4.1, %for.inc.4.1 ]
107 %incdec.ptr.4.2 = getelementptr inbounds ptr, ptr %i14, i64 -1
108 br i1 undef, label %for.body9.4.2, label %for.inc.4.2
110 for.inc.4.2: ; preds = %for.body9.4.2
111 br label %for.body9.4.3
113 for.body9.4.3: ; preds = %for.body9.4.3, %for.inc.4.2
114 %i15 = phi ptr [ %incdec.ptr.4.3, %for.body9.4.3 ], [ %incdec.ptr.4.2, %for.inc.4.2 ]
115 %incdec.ptr.4.3 = getelementptr inbounds ptr, ptr %i15, i64 -1
116 br i1 undef, label %for.body9.4.3, label %for.inc.4.3
118 for.inc.4.3: ; preds = %for.body9.4.3
119 br label %for.body9.4.4
121 for.body9.4.4: ; preds = %for.body9.4.4, %for.inc.4.3
122 %i16 = phi ptr [ %incdec.ptr.4.4, %for.body9.4.4 ], [ %incdec.ptr.4.3, %for.inc.4.3 ]
123 %incdec.ptr.4.4 = getelementptr inbounds ptr, ptr %i16, i64 -1
124 br i1 undef, label %for.body9.4.4, label %for.inc.4.4
126 for.inc.4.4: ; preds = %for.body9.4.4
127 br label %for.body9.4.5
129 for.body9.4.5: ; preds = %for.body9.4.5, %for.inc.4.4
130 %i17 = phi ptr [ %incdec.ptr.4.5, %for.body9.4.5 ], [ %incdec.ptr.4.4, %for.inc.4.4 ]
131 %incdec.ptr.4.5 = getelementptr inbounds ptr, ptr %i17, i64 -1
132 br i1 undef, label %for.body9.4.5, label %for.inc.4.5
134 for.inc.4.5: ; preds = %for.body9.4.5
135 br label %for.body9.5
137 for.body9.3.1: ; preds = %for.body9.3.1, %for.inc.3
138 %i18 = phi ptr [ %incdec.ptr.3.1, %for.body9.3.1 ], [ %incdec.ptr.3, %for.inc.3 ]
139 %incdec.ptr.3.1 = getelementptr inbounds ptr, ptr %i18, i64 -1
140 br i1 undef, label %for.body9.3.1, label %for.inc.3.1
142 for.inc.3.1: ; preds = %for.body9.3.1
143 br label %for.body9.3.2
145 for.body9.3.2: ; preds = %for.body9.3.2, %for.inc.3.1
146 %i19 = phi ptr [ %incdec.ptr.3.2, %for.body9.3.2 ], [ %incdec.ptr.3.1, %for.inc.3.1 ]
147 %incdec.ptr.3.2 = getelementptr inbounds ptr, ptr %i19, i64 -1
148 br i1 undef, label %for.body9.3.2, label %for.inc.3.2
150 for.inc.3.2: ; preds = %for.body9.3.2
151 br label %for.body9.3.3
153 for.body9.3.3: ; preds = %for.body9.3.3, %for.inc.3.2
154 %i20 = phi ptr [ %incdec.ptr.3.3, %for.body9.3.3 ], [ %incdec.ptr.3.2, %for.inc.3.2 ]
155 %incdec.ptr.3.3 = getelementptr inbounds ptr, ptr %i20, i64 -1
156 br i1 undef, label %for.body9.3.3, label %for.inc.3.3
158 for.inc.3.3: ; preds = %for.body9.3.3
159 br label %for.body9.3.4
161 for.body9.3.4: ; preds = %for.body9.3.4, %for.inc.3.3
162 %i21 = phi ptr [ %incdec.ptr.3.4, %for.body9.3.4 ], [ %incdec.ptr.3.3, %for.inc.3.3 ]
163 %incdec.ptr.3.4 = getelementptr inbounds ptr, ptr %i21, i64 -1
164 br i1 undef, label %for.body9.3.4, label %for.inc.3.4
166 for.inc.3.4: ; preds = %for.body9.3.4
167 br label %for.body9.3.5
169 for.body9.3.5: ; preds = %for.body9.3.5, %for.inc.3.4
170 %i22 = phi ptr [ %incdec.ptr.3.5, %for.body9.3.5 ], [ %incdec.ptr.3.4, %for.inc.3.4 ]
171 %incdec.ptr.3.5 = getelementptr inbounds ptr, ptr %i22, i64 -1
172 br i1 undef, label %for.body9.3.5, label %for.inc.3.5
174 for.inc.3.5: ; preds = %for.body9.3.5
175 br label %for.body9.4
177 for.body9.2.1: ; preds = %for.body9.2.1, %for.inc.2
178 %i23 = phi ptr [ %incdec.ptr.2.1, %for.body9.2.1 ], [ %incdec.ptr.2, %for.inc.2 ]
179 %incdec.ptr.2.1 = getelementptr inbounds ptr, ptr %i23, i64 -1
180 br i1 undef, label %for.body9.2.1, label %for.inc.2.1
182 for.inc.2.1: ; preds = %for.body9.2.1
183 br label %for.body9.2.2
185 for.body9.2.2: ; preds = %for.body9.2.2, %for.inc.2.1
186 %i24 = phi ptr [ %incdec.ptr.2.2, %for.body9.2.2 ], [ %incdec.ptr.2.1, %for.inc.2.1 ]
187 %incdec.ptr.2.2 = getelementptr inbounds ptr, ptr %i24, i64 -1
188 br i1 undef, label %for.body9.2.2, label %for.inc.2.2
190 for.inc.2.2: ; preds = %for.body9.2.2
191 br label %for.body9.2.3
193 for.body9.2.3: ; preds = %for.body9.2.3, %for.inc.2.2
194 %i25 = phi ptr [ %incdec.ptr.2.3, %for.body9.2.3 ], [ %incdec.ptr.2.2, %for.inc.2.2 ]
195 %incdec.ptr.2.3 = getelementptr inbounds ptr, ptr %i25, i64 -1
196 br i1 undef, label %for.body9.2.3, label %for.inc.2.3
198 for.inc.2.3: ; preds = %for.body9.2.3
199 br label %for.body9.2.4
201 for.body9.2.4: ; preds = %for.body9.2.4, %for.inc.2.3
202 %i26 = phi ptr [ %incdec.ptr.2.4, %for.body9.2.4 ], [ %incdec.ptr.2.3, %for.inc.2.3 ]
203 %incdec.ptr.2.4 = getelementptr inbounds ptr, ptr %i26, i64 -1
204 br i1 undef, label %for.body9.2.4, label %for.inc.2.4
206 for.inc.2.4: ; preds = %for.body9.2.4
207 br label %for.body9.2.5
209 for.body9.2.5: ; preds = %for.body9.2.5, %for.inc.2.4
210 %i27 = phi ptr [ %incdec.ptr.2.5, %for.body9.2.5 ], [ %incdec.ptr.2.4, %for.inc.2.4 ]
211 %incdec.ptr.2.5 = getelementptr inbounds ptr, ptr %i27, i64 -1
212 br i1 undef, label %for.body9.2.5, label %for.inc.2.5
214 for.inc.2.5: ; preds = %for.body9.2.5
215 br label %for.body9.3
217 for.body9.1.1: ; preds = %for.body9.1.1, %for.inc.1
218 %i28 = phi ptr [ %incdec.ptr.1.1, %for.body9.1.1 ], [ %incdec.ptr.1, %for.inc.1 ]
219 %incdec.ptr.1.1 = getelementptr inbounds ptr, ptr %i28, i64 -1
220 br i1 undef, label %for.body9.1.1, label %for.inc.1.1
222 for.inc.1.1: ; preds = %for.body9.1.1
223 br label %for.body9.1.2
225 for.body9.1.2: ; preds = %for.body9.1.2, %for.inc.1.1
226 %i29 = phi ptr [ %incdec.ptr.1.2, %for.body9.1.2 ], [ %incdec.ptr.1.1, %for.inc.1.1 ]
227 %incdec.ptr.1.2 = getelementptr inbounds ptr, ptr %i29, i64 -1
228 br i1 undef, label %for.body9.1.2, label %for.inc.1.2
230 for.inc.1.2: ; preds = %for.body9.1.2
231 br label %for.body9.1.3
233 for.body9.1.3: ; preds = %for.body9.1.3, %for.inc.1.2
234 %i30 = phi ptr [ %incdec.ptr.1.3, %for.body9.1.3 ], [ %incdec.ptr.1.2, %for.inc.1.2 ]
235 %incdec.ptr.1.3 = getelementptr inbounds ptr, ptr %i30, i64 -1
236 br i1 undef, label %for.body9.1.3, label %for.inc.1.3
238 for.inc.1.3: ; preds = %for.body9.1.3
239 br label %for.body9.1.4
241 for.body9.1.4: ; preds = %for.body9.1.4, %for.inc.1.3
242 %i31 = phi ptr [ %incdec.ptr.1.4, %for.body9.1.4 ], [ %incdec.ptr.1.3, %for.inc.1.3 ]
243 %incdec.ptr.1.4 = getelementptr inbounds ptr, ptr %i31, i64 -1
244 br i1 undef, label %for.body9.1.4, label %for.inc.1.4
246 for.inc.1.4: ; preds = %for.body9.1.4
247 br label %for.body9.1.5
249 for.body9.1.5: ; preds = %for.body9.1.5, %for.inc.1.4
250 %i32 = phi ptr [ %incdec.ptr.1.5, %for.body9.1.5 ], [ %incdec.ptr.1.4, %for.inc.1.4 ]
251 %incdec.ptr.1.5 = getelementptr inbounds ptr, ptr %i32, i64 -1
252 br i1 undef, label %for.body9.1.5, label %for.inc.1.5
254 for.inc.1.5: ; preds = %for.body9.1.5
255 br label %for.body9.2
257 for.body9.118: ; preds = %for.body9.118, %for.inc
258 %i33 = phi ptr [ %incdec.ptr, %for.inc ], [ %incdec.ptr.114, %for.body9.118 ]
259 %incdec.ptr.114 = getelementptr inbounds ptr, ptr %i33, i64 -1
260 br i1 undef, label %for.body9.118, label %for.inc.119
262 for.inc.119: ; preds = %for.body9.118
263 br label %for.body9.225
265 for.body9.225: ; preds = %for.body9.225, %for.inc.119
266 %i34 = phi ptr [ %incdec.ptr.114, %for.inc.119 ], [ %incdec.ptr.221, %for.body9.225 ]
267 %incdec.ptr.221 = getelementptr inbounds ptr, ptr %i34, i64 -1
268 %i36 = load i64, ptr %i34, align 8
269 br i1 undef, label %for.body9.225, label %for.inc.226
271 for.inc.226: ; preds = %for.body9.225
272 br label %for.body9.332
274 for.body9.332: ; preds = %for.body9.332, %for.inc.226
275 %i37 = phi ptr [ %incdec.ptr.221, %for.inc.226 ], [ %incdec.ptr.328, %for.body9.332 ]
276 %incdec.ptr.328 = getelementptr inbounds ptr, ptr %i37, i64 -1
277 br i1 undef, label %for.body9.332, label %for.inc.333
279 for.inc.333: ; preds = %for.body9.332
280 br label %for.body9.439
282 for.body9.439: ; preds = %for.body9.439, %for.inc.333
283 %i38 = phi ptr [ %incdec.ptr.328, %for.inc.333 ], [ %incdec.ptr.435, %for.body9.439 ]
284 %incdec.ptr.435 = getelementptr inbounds ptr, ptr %i38, i64 -1
285 br i1 undef, label %for.body9.439, label %for.inc.440
287 for.inc.440: ; preds = %for.body9.439
288 br label %for.body9.546
290 for.body9.546: ; preds = %for.body9.546, %for.inc.440
291 %i39 = phi ptr [ %incdec.ptr.435, %for.inc.440 ], [ %incdec.ptr.542, %for.body9.546 ]
292 %incdec.ptr.542 = getelementptr inbounds ptr, ptr %i39, i64 -1
293 br i1 undef, label %for.body9.546, label %for.inc.547
295 for.inc.547: ; preds = %for.body9.546
296 br label %for.body9.1