1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=print-mustexecute -disable-output 2>&1 | FileCheck %s --check-prefix=ME
3 ; RUN: opt < %s -passes=print-must-be-executed-contexts -disable-output 2>&1 | FileCheck %s --check-prefix=MBEC
5 ; void simple_conditional(int c) {
18 ; Start Instruction | Visit Set
21 ; C | A, B, C, D, E, F
22 ; D | A, B, C, D, E, F
28 ; There are no loops so print-mustexec will not do anything.
31 define void @simple_conditional(i32 %arg) {
34 ; MBEC: -- Explore context of: call void @A()
35 ; MBEC-NEXT: [F: simple_conditional] call void @A()
36 ; MBEC-NEXT: [F: simple_conditional] call void @B()
37 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
38 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
39 ; MBEC-NEXT: [F: simple_conditional] call void @E()
40 ; MBEC-NEXT: [F: simple_conditional] call void @F()
44 ; MBEC: -- Explore context of: call void @B()
45 ; MBEC-NEXT: [F: simple_conditional] call void @B()
46 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
47 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
48 ; MBEC-NEXT: [F: simple_conditional] call void @E()
49 ; MBEC-NEXT: [F: simple_conditional] call void @F()
50 ; MBEC-NEXT: [F: simple_conditional] call void @A()
52 ; MBEC: -- Explore context of: %tmp
54 %tmp = icmp eq i32 %arg, 0
55 br i1 %tmp, label %bb2, label %bb1
59 ; MBEC: -- Explore context of: call void @C()
60 ; MBEC-NEXT: [F: simple_conditional] call void @C()
61 ; MBEC-NEXT: [F: simple_conditional] call void @D()
62 ; MBEC-NEXT: [F: simple_conditional] br label %bb2
63 ; MBEC-NEXT: [F: simple_conditional] call void @E()
64 ; MBEC-NEXT: [F: simple_conditional] call void @F()
65 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
66 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
67 ; MBEC-NEXT: [F: simple_conditional] call void @B()
68 ; MBEC-NEXT: [F: simple_conditional] call void @A()
72 ; MBEC: -- Explore context of: call void @D()
73 ; MBEC-NEXT: [F: simple_conditional] call void @D()
74 ; MBEC-NEXT: [F: simple_conditional] br label %bb2
75 ; MBEC-NEXT: [F: simple_conditional] call void @E()
76 ; MBEC-NEXT: [F: simple_conditional] call void @F()
77 ; MBEC-NEXT: [F: simple_conditional] call void @C()
78 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
79 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
80 ; MBEC-NEXT: [F: simple_conditional] call void @B()
81 ; MBEC-NEXT: [F: simple_conditional] call void @A()
83 ; MBEC: -- Explore context of: br
87 bb2: ; preds = %bb, %bb1
89 ; MBEC: -- Explore context of: call void @E()
90 ; MBEC-NEXT: [F: simple_conditional] call void @E()
91 ; MBEC-NEXT: [F: simple_conditional] call void @F()
92 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
93 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
94 ; MBEC-NEXT: [F: simple_conditional] call void @B()
95 ; MBEC-NEXT: [F: simple_conditional] call void @A()
98 call void @F() ; might not return!
99 ; MBEC: -- Explore context of: call void @F()
100 ; MBEC-NEXT: [F: simple_conditional] call void @F()
101 ; MBEC-NEXT: [F: simple_conditional] call void @E()
102 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
103 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
104 ; MBEC-NEXT: [F: simple_conditional] call void @B()
105 ; MBEC-NEXT: [F: simple_conditional] call void @A()
109 ; MBEC: -- Explore context of: call void @G()
110 ; MBEC-NEXT: [F: simple_conditional] call void @G()
111 ; MBEC-NEXT: [F: simple_conditional] ret void
112 ; MBEC-NEXT: [F: simple_conditional] call void @F()
113 ; MBEC-NEXT: [F: simple_conditional] call void @E()
114 ; MBEC-NEXT: [F: simple_conditional] br i1 %tmp, label %bb2, label %bb1
115 ; MBEC-NEXT: [F: simple_conditional] %tmp = icmp eq i32 %arg, 0
116 ; MBEC-NEXT: [F: simple_conditional] call void @B()
117 ; MBEC-NEXT: [F: simple_conditional] call void @A()
119 ; MBEC: -- Explore context of: ret
125 ; void complex_loops_and_control(int c, int d) {
140 ; } while (++c == d);
147 ; Start Instruction | Visit Set
157 ; ME: define void @complex_loops_and_control
158 define void @complex_loops_and_control(i32 %arg, i32 %arg1) {
164 ; MBEC: -- Explore context of: call void @A()
165 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
166 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
167 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
168 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
169 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
170 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
171 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
173 ; MBEC: -- Explore context of: br
176 bb2: ; preds = %.backedge, %bb
177 %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
179 ; ME: call void @B() ; (mustexec in: bb2)
180 ; MBEC: -- Explore context of: call void @B()
181 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
182 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
183 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
184 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
185 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
186 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
187 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
188 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
189 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
190 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
192 ; MBEC: -- Explore context of: %tmp
193 %tmp = add nsw i32 %.0, 1
194 %tmp3 = icmp eq i32 %tmp, %arg1
195 br i1 %tmp3, label %bb4, label %bb5
202 ; MBEC: -- Explore context of: call void @C()
203 ; MBEC-NEXT: [F: complex_loops_and_control] call void @C()
204 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb5
205 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
206 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
207 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
208 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
209 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
210 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
211 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
212 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
213 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
214 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
216 ; MBEC: -- Explore context of: br
219 bb5: ; preds = %bb4, %bb2
220 %tmp6 = add nsw i32 %.0, 2
221 %tmp7 = icmp eq i32 %tmp6, %arg1
222 br i1 %tmp7, label %bb8, label %bb9
227 .backedge: ; preds = %bb8, %bb22
228 %.0.be = phi i32 [ %tmp6, %bb8 ], [ %.lcssa, %bb22 ]
236 ; MBEC: -- Explore context of: call void @D()
237 ; MBEC-NEXT: [F: complex_loops_and_control] call void @D()
238 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp10 = add nsw i32 %.0, 3
239 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp11 = icmp eq i32 %tmp10, %arg1
240 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp11, label %bb12, label %bb13
241 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
242 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
243 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
244 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
245 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
246 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
247 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
248 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
249 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
250 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
252 ; MBEC: -- Explore context of: %tmp10
253 %tmp10 = add nsw i32 %.0, 3
254 %tmp11 = icmp eq i32 %tmp10, %arg1
255 br i1 %tmp11, label %bb12, label %bb13
263 bb14: ; preds = %bb19, %bb13
264 %.1 = phi i32 [ %tmp10, %bb13 ], [ %tmp20, %bb19 ]
265 %tmp15 = add nsw i32 %.1, 1
266 %tmp16 = icmp eq i32 %tmp15, %arg1
267 br i1 %tmp16, label %bb17, label %bb18
269 bb17: ; preds = %bb14
272 bb18: ; preds = %bb14
278 ; MBEC: -- Explore context of: call void @E()
279 ; MBEC-NEXT: [F: complex_loops_and_control] call void @E()
280 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb19
281 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp20 = add nsw i32 %.1, 2
282 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp21 = icmp eq i32 %tmp20, %arg1
283 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp21, label %bb14, label %bb22
284 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp16, label %bb17, label %bb18
285 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp16 = icmp eq i32 %tmp15, %arg1
286 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp15 = add nsw i32 %.1, 1
287 ; MBEC-NEXT: [F: complex_loops_and_control] %.1 = phi i32 [ %tmp10, %bb13 ], [ %tmp20, %bb19 ]
288 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb14
289 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp11, label %bb12, label %bb13
290 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp11 = icmp eq i32 %tmp10, %arg1
291 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp10 = add nsw i32 %.0, 3
292 ; MBEC-NEXT: [F: complex_loops_and_control] call void @D()
293 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
294 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
295 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
296 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
297 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
298 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
299 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
300 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
301 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
302 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
304 ; MBEC: -- Explore context of: br
307 bb19: ; preds = %bb18, %bb17
308 %tmp20 = add nsw i32 %.1, 2
309 %tmp21 = icmp eq i32 %tmp20, %arg1
310 br i1 %tmp21, label %bb14, label %bb22
312 bb22: ; preds = %bb19
313 %.lcssa = phi i32 [ %tmp20, %bb19 ]
318 ; MBEC: -- Explore context of: call void @F()
319 ; MBEC-NEXT: [F: complex_loops_and_control] call void @F()
320 ; MBEC-NEXT: [F: complex_loops_and_control] %.lcssa = phi i32 [ %tmp20, %bb19 ]
321 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp21, label %bb14, label %bb22
322 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp21 = icmp eq i32 %tmp20, %arg1
323 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp20 = add nsw i32 %.1, 2
324 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp16, label %bb17, label %bb18
325 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp16 = icmp eq i32 %tmp15, %arg1
326 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp15 = add nsw i32 %.1, 1
327 ; MBEC-NEXT: [F: complex_loops_and_control] %.1 = phi i32 [ %tmp10, %bb13 ], [ %tmp20, %bb19 ]
328 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb14
329 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp11, label %bb12, label %bb13
330 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp11 = icmp eq i32 %tmp10, %arg1
331 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp10 = add nsw i32 %.0, 3
332 ; MBEC-NEXT: [F: complex_loops_and_control] call void @D()
333 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
334 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
335 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
336 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
337 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
338 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
339 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
340 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
341 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
342 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
344 ; MBEC: -- Explore context of: br
347 bb23: ; preds = %bb12
352 ; MBEC: -- Explore context of: call void @G()
353 ; MBEC-NEXT: [F: complex_loops_and_control] call void @G()
354 ; MBEC-NEXT: [F: complex_loops_and_control] ret void
355 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb23
356 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp11, label %bb12, label %bb13
357 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp11 = icmp eq i32 %tmp10, %arg1
358 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp10 = add nsw i32 %.0, 3
359 ; MBEC-NEXT: [F: complex_loops_and_control] call void @D()
360 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp7, label %bb8, label %bb9
361 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp7 = icmp eq i32 %tmp6, %arg1
362 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp6 = add nsw i32 %.0, 2
363 ; MBEC-NEXT: [F: complex_loops_and_control] br i1 %tmp3, label %bb4, label %bb5
364 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp3 = icmp eq i32 %tmp, %arg1
365 ; MBEC-NEXT: [F: complex_loops_and_control] %tmp = add nsw i32 %.0, 1
366 ; MBEC-NEXT: [F: complex_loops_and_control] call void @B()
367 ; MBEC-NEXT: [F: complex_loops_and_control] %.0 = phi i32 [ %arg, %bb ], [ %.0.be, %.backedge ]
368 ; MBEC-NEXT: [F: complex_loops_and_control] br label %bb2
369 ; MBEC-NEXT: [F: complex_loops_and_control] call void @A()
371 ; MBEC: -- Explore context of: ret
375 declare void @A() nounwind willreturn
377 declare void @B() nounwind willreturn
379 declare void @C() nounwind willreturn
381 declare void @D() nounwind willreturn
383 declare void @E() nounwind willreturn
385 declare void @F() nounwind
387 declare void @G() nounwind willreturn
389 declare i32 @g(ptr) nounwind willreturn
391 declare void @h(ptr) nounwind willreturn
393 define i32 @nonnull_exec_ctx_1(ptr %a, i32 %b) {
394 ; MBEC: -- Explore context of: %tmp3 = icmp eq i32 %b, 0
395 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
396 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
397 ; MBEC-NEXT: -- Explore context of: br i1 %tmp3, label %ex, label %hd
398 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
399 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
400 ; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(ptr nonnull %a)
401 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp5 = tail call i32 @g(ptr nonnull %a)
402 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] ret i32 %tmp5
403 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
404 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
405 ; MBEC-NEXT: -- Explore context of: ret i32 %tmp5
406 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] ret i32 %tmp5
407 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp5 = tail call i32 @g(ptr nonnull %a)
408 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
409 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
410 ; MBEC-NEXT: -- Explore context of: %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
411 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
412 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
413 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
414 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
415 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
416 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
417 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
418 ; MBEC-NEXT: -- Explore context of: tail call void @h(ptr %a)
419 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
420 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
421 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
422 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
423 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
424 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
425 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
426 ; MBEC-NEXT: -- Explore context of: %tmp8 = add nuw i32 %tmp7, 1
427 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
428 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
429 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
430 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
431 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
432 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
433 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
434 ; MBEC-NEXT: -- Explore context of: %tmp9 = icmp eq i32 %tmp8, %b
435 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
436 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
437 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
438 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
439 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
440 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
441 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
442 ; MBEC-NEXT: -- Explore context of: br i1 %tmp9, label %ex, label %hd
443 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp9, label %ex, label %hd
444 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp9 = icmp eq i32 %tmp8, %b
445 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp8 = add nuw i32 %tmp7, 1
446 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] tail call void @h(ptr %a)
447 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
448 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] br i1 %tmp3, label %ex, label %hd
449 ; MBEC-NEXT: [F: nonnull_exec_ctx_1] %tmp3 = icmp eq i32 %b, 0
451 %tmp3 = icmp eq i32 %b, 0
452 br i1 %tmp3, label %ex, label %hd
455 %tmp5 = tail call i32 @g(ptr nonnull %a)
459 %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
460 tail call void @h(ptr %a)
461 %tmp8 = add nuw i32 %tmp7, 1
462 %tmp9 = icmp eq i32 %tmp8, %b
463 br i1 %tmp9, label %ex, label %hd
466 define i32 @nonnull_exec_ctx_2(ptr %a, i32 %b) nounwind willreturn {
467 ; MBEC: -- Explore context of: %tmp3 = icmp eq i32 %b, 0
468 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
469 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
470 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
471 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
472 ; MBEC-NEXT: -- Explore context of: br i1 %tmp3, label %ex, label %hd
473 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
474 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
475 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
476 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
477 ; MBEC-NEXT: -- Explore context of: %tmp5 = tail call i32 @g(ptr nonnull %a)
478 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
479 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
480 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
481 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
482 ; MBEC-NEXT: -- Explore context of: ret i32 %tmp5
483 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
484 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
485 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
486 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
487 ; MBEC-NEXT: -- Explore context of: %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
488 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
489 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
490 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
491 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
492 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
493 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
494 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
495 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
496 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
497 ; MBEC-NEXT: -- Explore context of: tail call void @h(ptr %a)
498 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
499 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
500 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
501 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
502 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
503 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
504 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
505 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
506 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
507 ; MBEC-NEXT: -- Explore context of: %tmp8 = add nuw i32 %tmp7, 1
508 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
509 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
510 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
511 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
512 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
513 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
514 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
515 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
516 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
517 ; MBEC-NEXT: -- Explore context of: %tmp9 = icmp eq i32 %tmp8, %b
518 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
519 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
520 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
521 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
522 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
523 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
524 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
525 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
526 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
527 ; MBEC-NEXT: -- Explore context of: br i1 %tmp9, label %ex, label %hd
528 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp9, label %ex, label %hd
529 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp5 = tail call i32 @g(ptr nonnull %a)
530 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] ret i32 %tmp5
531 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp9 = icmp eq i32 %tmp8, %b
532 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp8 = add nuw i32 %tmp7, 1
533 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] tail call void @h(ptr %a)
534 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
535 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] br i1 %tmp3, label %ex, label %hd
536 ; MBEC-NEXT: [F: nonnull_exec_ctx_2] %tmp3 = icmp eq i32 %b, 0
538 %tmp3 = icmp eq i32 %b, 0
539 br i1 %tmp3, label %ex, label %hd
542 %tmp5 = tail call i32 @g(ptr nonnull %a)
546 %tmp7 = phi i32 [ %tmp8, %hd ], [ 0, %en ]
547 tail call void @h(ptr %a)
548 %tmp8 = add nuw i32 %tmp7, 1
549 %tmp9 = icmp eq i32 %tmp8, %b
550 br i1 %tmp9, label %ex, label %hd