1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -print-mustexecute -disable-output 2>&1 | FileCheck %s --check-prefix=ME
3 ; RUN: opt < %s -print-must-be-executed-contexts -disable-output 2>&1 | FileCheck %s --check-prefix=MBEC
4 ; RUN: opt < %s -passes=print-must-be-executed-contexts -disable-output 2>&1 | FileCheck %s --check-prefix=MBEC
6 ; void simple_conditional(int c) {
19 ; Start Instruction | Visit Set
22 ; C | A, B, C, D, E, F
23 ; D | A, B, C, D, E, F
29 ; There are no loops so print-mustexec will not do anything.
32 define void @simple_conditional(i32 %arg) {
35 ; MBEC: -- Explore context of: call void @A()
36 ; MBEC-NEXT: [F: simple_conditional] call void @A()
37 ; MBEC-NEXT: [F: simple_conditional] call void @B()
38 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
39 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
40 ; MBEC-NEXT: [F: simple_conditional] call void @E()
41 ; MBEC-NEXT: [F: simple_conditional] call void @F()
45 ; MBEC: -- Explore context of: call void @B()
46 ; MBEC-NEXT: [F: simple_conditional] call void @B()
47 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
48 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
49 ; MBEC-NEXT: [F: simple_conditional] call void @E()
50 ; MBEC-NEXT: [F: simple_conditional] call void @F()
51 ; MBEC-NEXT: [F: simple_conditional] call void @A()
53 ; MBEC: -- Explore context of: %tmp
55 %tmp = icmp eq i32 %arg, 0
56 br i1 %tmp, label %bb2, label %bb1
60 ; MBEC: -- Explore context of: call void @C()
61 ; MBEC-NEXT: [F: simple_conditional] call void @C()
62 ; MBEC-NEXT: [F: simple_conditional] call void @D()
63 ; MBEC-NEXT: [F: simple_conditional] br label %bb2
64 ; MBEC-NEXT: [F: simple_conditional] call void @E()
65 ; MBEC-NEXT: [F: simple_conditional] call void @F()
66 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
67 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
68 ; MBEC-NEXT: [F: simple_conditional] call void @B()
69 ; MBEC-NEXT: [F: simple_conditional] call void @A()
73 ; MBEC: -- Explore context of: call void @D()
74 ; MBEC-NEXT: [F: simple_conditional] call void @D()
75 ; MBEC-NEXT: [F: simple_conditional] br label %bb2
76 ; MBEC-NEXT: [F: simple_conditional] call void @E()
77 ; MBEC-NEXT: [F: simple_conditional] call void @F()
78 ; MBEC-NEXT: [F: simple_conditional] call void @C()
79 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
80 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
81 ; MBEC-NEXT: [F: simple_conditional] call void @B()
82 ; MBEC-NEXT: [F: simple_conditional] call void @A()
84 ; MBEC: -- Explore context of: br
88 bb2: ; preds = %bb, %bb1
90 ; MBEC: -- Explore context of: call void @E()
91 ; MBEC-NEXT: [F: simple_conditional] call void @E()
92 ; MBEC-NEXT: [F: simple_conditional] call void @F()
93 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
94 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
95 ; MBEC-NEXT: [F: simple_conditional] call void @B()
96 ; MBEC-NEXT: [F: simple_conditional] call void @A()
99 call void @F() ; might not return!
100 ; MBEC: -- Explore context of: call void @F()
101 ; MBEC-NEXT: [F: simple_conditional] call void @F()
102 ; MBEC-NEXT: [F: simple_conditional] call void @E()
103 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
104 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
105 ; MBEC-NEXT: [F: simple_conditional] call void @B()
106 ; MBEC-NEXT: [F: simple_conditional] call void @A()
110 ; MBEC: -- Explore context of: call void @G()
111 ; MBEC-NEXT: [F: simple_conditional] call void @G()
112 ; MBEC-NEXT: [F: simple_conditional] ret void
113 ; MBEC-NEXT: [F: simple_conditional] call void @F()
114 ; MBEC-NEXT: [F: simple_conditional] call void @E()
115 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
116 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
117 ; MBEC-NEXT: [F: simple_conditional] call void @B()
118 ; MBEC-NEXT: [F: simple_conditional] call void @A()
120 ; MBEC: -- Explore context of: ret
126 ; void complex_loops_and_control(int c, int d) {
141 ; } while (++c == d);
148 ; Start Instruction | Visit Set
158 ; ME: define void @complex_loops_and_control
159 define void @complex_loops_and_control(i32 %arg, i32 %arg1) {
165 ; MBEC: -- Explore context of: call void @A()
166 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
167 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
168 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
169 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
170 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
171 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
172 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
174 ; MBEC: -- Explore context of: br
177 bb2: ; preds = %.backedge, %bb
178 %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
180 ; ME: call void @B() ; (mustexec in: bb2)
181 ; MBEC: -- Explore context of: call void @B()
182 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
183 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
184 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
185 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
186 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
187 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
188 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
189 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
190 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
191 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
193 ; MBEC: -- Explore context of: %tmp
194 %tmp = add nsw i32 %.0, 1
195 %tmp3 = icmp eq i32 %tmp, %arg1
196 br i1 %tmp3, label %bb4, label %bb5
203 ; MBEC: -- Explore context of: call void @C()
204 ; MBEC-NEXT: [F: complex_loops_and_control] call void @C()
205 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb5
206 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
207 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
208 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
209 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
210 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
211 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
212 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
213 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
214 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
215 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
217 ; MBEC: -- Explore context of: br
220 bb5: ; preds = %bb4, %bb2
221 %tmp6 = add nsw i32 %.0, 2
222 %tmp7 = icmp eq i32 %tmp6, %arg1
223 br i1 %tmp7, label %bb8, label %bb9
228 .backedge: ; preds = %bb8, %bb22
229 %.0.be = phi i32 [ %tmp6, %bb8 ], [ %.lcssa, %bb22 ]
237 ; MBEC: -- Explore context of: call void @D()
238 ; MBEC-NEXT: [F: complex_loops_and_control] call void @D()
239 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp10 = add nsw i32 %.0, 3
240 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp11 = icmp eq i32 %tmp10, %arg1
241 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp11, label %bb12, label %bb13
242 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
243 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
244 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
245 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
246 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
247 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
248 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
249 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
250 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
251 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
253 ; MBEC: -- Explore context of: %tmp10
254 %tmp10 = add nsw i32 %.0, 3
255 %tmp11 = icmp eq i32 %tmp10, %arg1
256 br i1 %tmp11, label %bb12, label %bb13
264 bb14: ; preds = %bb19, %bb13
265 %.1 = phi i32 [ %tmp10, %bb13 ], [ %tmp20, %bb19 ]
266 %tmp15 = add nsw i32 %.1, 1
267 %tmp16 = icmp eq i32 %tmp15, %arg1
268 br i1 %tmp16, label %bb17, label %bb18
270 bb17: ; preds = %bb14
273 bb18: ; preds = %bb14
279 ; MBEC: -- Explore context of: call void @E()
280 ; MBEC-NEXT: [F: complex_loops_and_control] call void @E()
281 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb19
282 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp20 = add nsw i32 %.1, 2
283 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp21 = icmp eq i32 %tmp20, %arg1
284 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp21, label %bb14, label %bb22
285 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp16, label %bb17, label %bb18
286 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp16 = icmp eq i32 %tmp15, %arg1
287 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp15 = add nsw i32 %.1, 1
288 ; MBEC-NEXT: [F: complex_loops_and_control] %.1 = phi i32 [ %tmp10, %bb13 ], [ %tmp20, %bb19 ]
289 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb14
290 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp11, label %bb12, label %bb13
291 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp11 = icmp eq i32 %tmp10, %arg1
292 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp10 = add nsw i32 %.0, 3
293 ; MBEC-NEXT: [F: complex_loops_and_control] call void @D()
294 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
295 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
296 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
297 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
298 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
299 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
300 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
301 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
302 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
303 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
305 ; MBEC: -- Explore context of: br
308 bb19: ; preds = %bb18, %bb17
309 %tmp20 = add nsw i32 %.1, 2
310 %tmp21 = icmp eq i32 %tmp20, %arg1
311 br i1 %tmp21, label %bb14, label %bb22
313 bb22: ; preds = %bb19
314 %.lcssa = phi i32 [ %tmp20, %bb19 ]
319 ; MBEC: -- Explore context of: call void @F()
320 ; MBEC-NEXT: [F: complex_loops_and_control] call void @F()
321 ; MBEC-NEXT: [F: complex_loops_and_control] %.lcssa = phi i32 [ %tmp20, %bb19 ]
322 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp21, label %bb14, label %bb22
323 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp21 = icmp eq i32 %tmp20, %arg1
324 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp20 = add nsw i32 %.1, 2
325 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp16, label %bb17, label %bb18
326 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp16 = icmp eq i32 %tmp15, %arg1
327 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp15 = add nsw i32 %.1, 1
328 ; MBEC-NEXT: [F: complex_loops_and_control] %.1 = phi i32 [ %tmp10, %bb13 ], [ %tmp20, %bb19 ]
329 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb14
330 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp11, label %bb12, label %bb13
331 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp11 = icmp eq i32 %tmp10, %arg1
332 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp10 = add nsw i32 %.0, 3
333 ; MBEC-NEXT: [F: complex_loops_and_control] call void @D()
334 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
335 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
336 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
337 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
338 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
339 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
340 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
341 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
342 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
343 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
345 ; MBEC: -- Explore context of: br
348 bb23: ; preds = %bb12
353 ; MBEC: -- Explore context of: call void @G()
354 ; MBEC-NEXT: [F: complex_loops_and_control] call void @G()
355 ; MBEC-NEXT: [F: complex_loops_and_control] ret void
356 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb23
357 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp11, label %bb12, label %bb13
358 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp11 = icmp eq i32 %tmp10, %arg1
359 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp10 = add nsw i32 %.0, 3
360 ; MBEC-NEXT: [F: complex_loops_and_control] call void @D()
361 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
362 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
363 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
364 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
365 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
366 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
367 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
368 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
369 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
370 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
372 ; MBEC: -- Explore context of: ret
376 declare void @A() nounwind willreturn
378 declare void @B() nounwind willreturn
380 declare void @C() nounwind willreturn
382 declare void @D() nounwind willreturn
384 declare void @E() nounwind willreturn
386 declare void @F() nounwind
388 declare void @G() nounwind willreturn
390 declare i32 @g(i32*) nounwind willreturn
392 declare void @h(i32*) nounwind willreturn
394 define i32 @nonnull_exec_ctx_1(i32* %a, i32 %b) {
395 ; MBEC: -- Explore context of: %tmp3 = icmp eq i32 %b, 0
396 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
397 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
398 ; MBEC-NEXT: -- Explore context of: br i1 %tmp3, label %ex, label %hd
399 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
400 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
401 ; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(i32* nonnull %a)
402 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp5 = tail call i32 @g(i32* nonnull %a)
403 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] ret i32 %tmp5
404 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
405 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
406 ; MBEC-NEXT: -- Explore context of: ret i32 %tmp5
407 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] ret i32 %tmp5
408 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp5 = tail call i32 @g(i32* nonnull %a)
409 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
410 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
411 ; MBEC-NEXT: -- Explore context of: %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
412 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
413 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a)
414 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
415 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
416 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
417 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
418 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
419 ; MBEC-NEXT: -- Explore context of: tail call void @h(i32* %a)
420 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a)
421 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
422 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
423 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
424 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
425 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
426 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
427 ; MBEC-NEXT: -- Explore context of: %tmp8 = add nuw i32 %tmp7, 1
428 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
429 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
430 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
431 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a)
432 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
433 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
434 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
435 ; MBEC-NEXT: -- Explore context of: %tmp9 = icmp eq i32 %tmp8, %b
436 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
437 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
438 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
439 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a)
440 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
441 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
442 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
443 ; MBEC-NEXT: -- Explore context of: br i1 %tmp9, label %ex, label %hd
444 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
445 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
446 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
447 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(i32* %a)
448 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
449 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
450 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
452 %tmp3 = icmp eq i32 %b, 0
453 br i1 %tmp3, label %ex, label %hd
456 %tmp5 = tail call i32 @g(i32* nonnull %a)
460 %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
461 tail call void @h(i32* %a)
462 %tmp8 = add nuw i32 %tmp7, 1
463 %tmp9 = icmp eq i32 %tmp8, %b
464 br i1 %tmp9, label %ex, label %hd
467 define i32 @nonnull_exec_ctx_2(i32* %a, i32 %b) nounwind willreturn {
468 ; MBEC: -- Explore context of: %tmp3 = icmp eq i32 %b, 0
469 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
470 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
471 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
472 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
473 ; MBEC-NEXT: -- Explore context of: br i1 %tmp3, label %ex, label %hd
474 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
475 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
476 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
477 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
478 ; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(i32* nonnull %a)
479 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
480 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
481 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
482 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
483 ; MBEC-NEXT: -- Explore context of: ret i32 %tmp5
484 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
485 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
486 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
487 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
488 ; MBEC-NEXT: -- Explore context of: %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
489 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
490 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a)
491 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
492 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
493 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
494 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
495 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
496 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
497 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
498 ; MBEC-NEXT: -- Explore context of: tail call void @h(i32* %a)
499 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a)
500 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
501 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
502 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
503 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
504 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
505 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
506 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
507 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
508 ; MBEC-NEXT: -- Explore context of: %tmp8 = add nuw i32 %tmp7, 1
509 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
510 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
511 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
512 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
513 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
514 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a)
515 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
516 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
517 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
518 ; MBEC-NEXT: -- Explore context of: %tmp9 = icmp eq i32 %tmp8, %b
519 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
520 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
521 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
522 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
523 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
524 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a)
525 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
526 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
527 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
528 ; MBEC-NEXT: -- Explore context of: br i1 %tmp9, label %ex, label %hd
529 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
530 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(i32* nonnull %a)
531 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
532 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
533 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
534 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(i32* %a)
535 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
536 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
537 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
539 %tmp3 = icmp eq i32 %b, 0
540 br i1 %tmp3, label %ex, label %hd
543 %tmp5 = tail call i32 @g(i32* nonnull %a)
547 %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
548 tail call void @h(i32* %a)
549 %tmp8 = add nuw i32 %tmp7, 1
550 %tmp9 = icmp eq i32 %tmp8, %b
551 br i1 %tmp9, label %ex, label %hd