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 i32** null, align 8
7 define dso_local i32 @main() local_unnamed_addr {
9 %.pre.pre = load i32**, i32*** @d, align 8
12 for.body9: ; preds = %for.body9, %entry
13 %i = phi i32** [ %.pre.pre, %entry ], [ %incdec.ptr, %for.body9 ]
14 %incdec.ptr = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.1, %for.body9.1 ], [ %incdec.ptr.542, %for.inc.547 ]
22 %incdec.ptr.1 = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.2, %for.body9.2 ], [ %incdec.ptr.1.5, %for.inc.1.5 ]
30 %incdec.ptr.2 = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.3, %for.body9.3 ], [ %incdec.ptr.2.5, %for.inc.2.5 ]
38 %incdec.ptr.3 = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.4, %for.body9.4 ], [ %incdec.ptr.3.5, %for.inc.3.5 ]
46 %incdec.ptr.4 = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.5, %for.body9.5 ], [ %incdec.ptr.4.5, %for.inc.4.5 ]
54 %incdec.ptr.5 = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.5.1, %for.body9.5.1 ], [ %incdec.ptr.5, %for.inc.5 ]
62 %incdec.ptr.5.1 = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.5.2, %for.body9.5.2 ], [ %incdec.ptr.5.1, %for.inc.5.1 ]
70 %incdec.ptr.5.2 = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.5.3, %for.body9.5.3 ], [ %incdec.ptr.5.2, %for.inc.5.2 ]
78 %incdec.ptr.5.3 = getelementptr inbounds i32*, i32** %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 i32** [ %incdec.ptr.5.4, %for.body9.5.4 ], [ %incdec.ptr.5.3, %for.inc.5.3 ]
86 %incdec.ptr.5.4 = getelementptr inbounds i32*, i32** %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 i32** [ undef, %for.body9.5.5 ], [ %incdec.ptr.5.4, %for.inc.5.4 ]
94 %i11 = bitcast i32** %i10 to i64*
95 %i12 = load i64, i64* %i11, align 8
96 br label %for.body9.5.5
98 for.body9.4.1: ; preds = %for.body9.4.1, %for.inc.4
99 %i13 = phi i32** [ %incdec.ptr.4.1, %for.body9.4.1 ], [ %incdec.ptr.4, %for.inc.4 ]
100 %incdec.ptr.4.1 = getelementptr inbounds i32*, i32** %i13, i64 -1
101 br i1 undef, label %for.body9.4.1, label %for.inc.4.1
103 for.inc.4.1: ; preds = %for.body9.4.1
104 br label %for.body9.4.2
106 for.body9.4.2: ; preds = %for.body9.4.2, %for.inc.4.1
107 %i14 = phi i32** [ %incdec.ptr.4.2, %for.body9.4.2 ], [ %incdec.ptr.4.1, %for.inc.4.1 ]
108 %incdec.ptr.4.2 = getelementptr inbounds i32*, i32** %i14, i64 -1
109 br i1 undef, label %for.body9.4.2, label %for.inc.4.2
111 for.inc.4.2: ; preds = %for.body9.4.2
112 br label %for.body9.4.3
114 for.body9.4.3: ; preds = %for.body9.4.3, %for.inc.4.2
115 %i15 = phi i32** [ %incdec.ptr.4.3, %for.body9.4.3 ], [ %incdec.ptr.4.2, %for.inc.4.2 ]
116 %incdec.ptr.4.3 = getelementptr inbounds i32*, i32** %i15, i64 -1
117 br i1 undef, label %for.body9.4.3, label %for.inc.4.3
119 for.inc.4.3: ; preds = %for.body9.4.3
120 br label %for.body9.4.4
122 for.body9.4.4: ; preds = %for.body9.4.4, %for.inc.4.3
123 %i16 = phi i32** [ %incdec.ptr.4.4, %for.body9.4.4 ], [ %incdec.ptr.4.3, %for.inc.4.3 ]
124 %incdec.ptr.4.4 = getelementptr inbounds i32*, i32** %i16, i64 -1
125 br i1 undef, label %for.body9.4.4, label %for.inc.4.4
127 for.inc.4.4: ; preds = %for.body9.4.4
128 br label %for.body9.4.5
130 for.body9.4.5: ; preds = %for.body9.4.5, %for.inc.4.4
131 %i17 = phi i32** [ %incdec.ptr.4.5, %for.body9.4.5 ], [ %incdec.ptr.4.4, %for.inc.4.4 ]
132 %incdec.ptr.4.5 = getelementptr inbounds i32*, i32** %i17, i64 -1
133 br i1 undef, label %for.body9.4.5, label %for.inc.4.5
135 for.inc.4.5: ; preds = %for.body9.4.5
136 br label %for.body9.5
138 for.body9.3.1: ; preds = %for.body9.3.1, %for.inc.3
139 %i18 = phi i32** [ %incdec.ptr.3.1, %for.body9.3.1 ], [ %incdec.ptr.3, %for.inc.3 ]
140 %incdec.ptr.3.1 = getelementptr inbounds i32*, i32** %i18, i64 -1
141 br i1 undef, label %for.body9.3.1, label %for.inc.3.1
143 for.inc.3.1: ; preds = %for.body9.3.1
144 br label %for.body9.3.2
146 for.body9.3.2: ; preds = %for.body9.3.2, %for.inc.3.1
147 %i19 = phi i32** [ %incdec.ptr.3.2, %for.body9.3.2 ], [ %incdec.ptr.3.1, %for.inc.3.1 ]
148 %incdec.ptr.3.2 = getelementptr inbounds i32*, i32** %i19, i64 -1
149 br i1 undef, label %for.body9.3.2, label %for.inc.3.2
151 for.inc.3.2: ; preds = %for.body9.3.2
152 br label %for.body9.3.3
154 for.body9.3.3: ; preds = %for.body9.3.3, %for.inc.3.2
155 %i20 = phi i32** [ %incdec.ptr.3.3, %for.body9.3.3 ], [ %incdec.ptr.3.2, %for.inc.3.2 ]
156 %incdec.ptr.3.3 = getelementptr inbounds i32*, i32** %i20, i64 -1
157 br i1 undef, label %for.body9.3.3, label %for.inc.3.3
159 for.inc.3.3: ; preds = %for.body9.3.3
160 br label %for.body9.3.4
162 for.body9.3.4: ; preds = %for.body9.3.4, %for.inc.3.3
163 %i21 = phi i32** [ %incdec.ptr.3.4, %for.body9.3.4 ], [ %incdec.ptr.3.3, %for.inc.3.3 ]
164 %incdec.ptr.3.4 = getelementptr inbounds i32*, i32** %i21, i64 -1
165 br i1 undef, label %for.body9.3.4, label %for.inc.3.4
167 for.inc.3.4: ; preds = %for.body9.3.4
168 br label %for.body9.3.5
170 for.body9.3.5: ; preds = %for.body9.3.5, %for.inc.3.4
171 %i22 = phi i32** [ %incdec.ptr.3.5, %for.body9.3.5 ], [ %incdec.ptr.3.4, %for.inc.3.4 ]
172 %incdec.ptr.3.5 = getelementptr inbounds i32*, i32** %i22, i64 -1
173 br i1 undef, label %for.body9.3.5, label %for.inc.3.5
175 for.inc.3.5: ; preds = %for.body9.3.5
176 br label %for.body9.4
178 for.body9.2.1: ; preds = %for.body9.2.1, %for.inc.2
179 %i23 = phi i32** [ %incdec.ptr.2.1, %for.body9.2.1 ], [ %incdec.ptr.2, %for.inc.2 ]
180 %incdec.ptr.2.1 = getelementptr inbounds i32*, i32** %i23, i64 -1
181 br i1 undef, label %for.body9.2.1, label %for.inc.2.1
183 for.inc.2.1: ; preds = %for.body9.2.1
184 br label %for.body9.2.2
186 for.body9.2.2: ; preds = %for.body9.2.2, %for.inc.2.1
187 %i24 = phi i32** [ %incdec.ptr.2.2, %for.body9.2.2 ], [ %incdec.ptr.2.1, %for.inc.2.1 ]
188 %incdec.ptr.2.2 = getelementptr inbounds i32*, i32** %i24, i64 -1
189 br i1 undef, label %for.body9.2.2, label %for.inc.2.2
191 for.inc.2.2: ; preds = %for.body9.2.2
192 br label %for.body9.2.3
194 for.body9.2.3: ; preds = %for.body9.2.3, %for.inc.2.2
195 %i25 = phi i32** [ %incdec.ptr.2.3, %for.body9.2.3 ], [ %incdec.ptr.2.2, %for.inc.2.2 ]
196 %incdec.ptr.2.3 = getelementptr inbounds i32*, i32** %i25, i64 -1
197 br i1 undef, label %for.body9.2.3, label %for.inc.2.3
199 for.inc.2.3: ; preds = %for.body9.2.3
200 br label %for.body9.2.4
202 for.body9.2.4: ; preds = %for.body9.2.4, %for.inc.2.3
203 %i26 = phi i32** [ %incdec.ptr.2.4, %for.body9.2.4 ], [ %incdec.ptr.2.3, %for.inc.2.3 ]
204 %incdec.ptr.2.4 = getelementptr inbounds i32*, i32** %i26, i64 -1
205 br i1 undef, label %for.body9.2.4, label %for.inc.2.4
207 for.inc.2.4: ; preds = %for.body9.2.4
208 br label %for.body9.2.5
210 for.body9.2.5: ; preds = %for.body9.2.5, %for.inc.2.4
211 %i27 = phi i32** [ %incdec.ptr.2.5, %for.body9.2.5 ], [ %incdec.ptr.2.4, %for.inc.2.4 ]
212 %incdec.ptr.2.5 = getelementptr inbounds i32*, i32** %i27, i64 -1
213 br i1 undef, label %for.body9.2.5, label %for.inc.2.5
215 for.inc.2.5: ; preds = %for.body9.2.5
216 br label %for.body9.3
218 for.body9.1.1: ; preds = %for.body9.1.1, %for.inc.1
219 %i28 = phi i32** [ %incdec.ptr.1.1, %for.body9.1.1 ], [ %incdec.ptr.1, %for.inc.1 ]
220 %incdec.ptr.1.1 = getelementptr inbounds i32*, i32** %i28, i64 -1
221 br i1 undef, label %for.body9.1.1, label %for.inc.1.1
223 for.inc.1.1: ; preds = %for.body9.1.1
224 br label %for.body9.1.2
226 for.body9.1.2: ; preds = %for.body9.1.2, %for.inc.1.1
227 %i29 = phi i32** [ %incdec.ptr.1.2, %for.body9.1.2 ], [ %incdec.ptr.1.1, %for.inc.1.1 ]
228 %incdec.ptr.1.2 = getelementptr inbounds i32*, i32** %i29, i64 -1
229 br i1 undef, label %for.body9.1.2, label %for.inc.1.2
231 for.inc.1.2: ; preds = %for.body9.1.2
232 br label %for.body9.1.3
234 for.body9.1.3: ; preds = %for.body9.1.3, %for.inc.1.2
235 %i30 = phi i32** [ %incdec.ptr.1.3, %for.body9.1.3 ], [ %incdec.ptr.1.2, %for.inc.1.2 ]
236 %incdec.ptr.1.3 = getelementptr inbounds i32*, i32** %i30, i64 -1
237 br i1 undef, label %for.body9.1.3, label %for.inc.1.3
239 for.inc.1.3: ; preds = %for.body9.1.3
240 br label %for.body9.1.4
242 for.body9.1.4: ; preds = %for.body9.1.4, %for.inc.1.3
243 %i31 = phi i32** [ %incdec.ptr.1.4, %for.body9.1.4 ], [ %incdec.ptr.1.3, %for.inc.1.3 ]
244 %incdec.ptr.1.4 = getelementptr inbounds i32*, i32** %i31, i64 -1
245 br i1 undef, label %for.body9.1.4, label %for.inc.1.4
247 for.inc.1.4: ; preds = %for.body9.1.4
248 br label %for.body9.1.5
250 for.body9.1.5: ; preds = %for.body9.1.5, %for.inc.1.4
251 %i32 = phi i32** [ %incdec.ptr.1.5, %for.body9.1.5 ], [ %incdec.ptr.1.4, %for.inc.1.4 ]
252 %incdec.ptr.1.5 = getelementptr inbounds i32*, i32** %i32, i64 -1
253 br i1 undef, label %for.body9.1.5, label %for.inc.1.5
255 for.inc.1.5: ; preds = %for.body9.1.5
256 br label %for.body9.2
258 for.body9.118: ; preds = %for.body9.118, %for.inc
259 %i33 = phi i32** [ %incdec.ptr, %for.inc ], [ %incdec.ptr.114, %for.body9.118 ]
260 %incdec.ptr.114 = getelementptr inbounds i32*, i32** %i33, i64 -1
261 br i1 undef, label %for.body9.118, label %for.inc.119
263 for.inc.119: ; preds = %for.body9.118
264 br label %for.body9.225
266 for.body9.225: ; preds = %for.body9.225, %for.inc.119
267 %i34 = phi i32** [ %incdec.ptr.114, %for.inc.119 ], [ %incdec.ptr.221, %for.body9.225 ]
268 %incdec.ptr.221 = getelementptr inbounds i32*, i32** %i34, i64 -1
269 %i35 = bitcast i32** %i34 to i64*
270 %i36 = load i64, i64* %i35, align 8
271 br i1 undef, label %for.body9.225, label %for.inc.226
273 for.inc.226: ; preds = %for.body9.225
274 br label %for.body9.332
276 for.body9.332: ; preds = %for.body9.332, %for.inc.226
277 %i37 = phi i32** [ %incdec.ptr.221, %for.inc.226 ], [ %incdec.ptr.328, %for.body9.332 ]
278 %incdec.ptr.328 = getelementptr inbounds i32*, i32** %i37, i64 -1
279 br i1 undef, label %for.body9.332, label %for.inc.333
281 for.inc.333: ; preds = %for.body9.332
282 br label %for.body9.439
284 for.body9.439: ; preds = %for.body9.439, %for.inc.333
285 %i38 = phi i32** [ %incdec.ptr.328, %for.inc.333 ], [ %incdec.ptr.435, %for.body9.439 ]
286 %incdec.ptr.435 = getelementptr inbounds i32*, i32** %i38, i64 -1
287 br i1 undef, label %for.body9.439, label %for.inc.440
289 for.inc.440: ; preds = %for.body9.439
290 br label %for.body9.546
292 for.body9.546: ; preds = %for.body9.546, %for.inc.440
293 %i39 = phi i32** [ %incdec.ptr.435, %for.inc.440 ], [ %incdec.ptr.542, %for.body9.546 ]
294 %incdec.ptr.542 = getelementptr inbounds i32*, i32** %i39, i64 -1
295 br i1 undef, label %for.body9.546, label %for.inc.547
297 for.inc.547: ; preds = %for.body9.546
298 br label %for.body9.1