1 // RUN: mlir-opt %s -pass-pipeline="builtin.module(func.func(test-print-dominance))" -split-input-file | FileCheck %s
3 // CHECK-LABEL: Testing : func_condBranch
4 func.func @func_condBranch(%cond : i1) {
5 cf.cond_br %cond, ^bb1, ^bb2
14 // CHECK: --- DominanceInfo ---
15 // CHECK: Nearest(0, 0) = 0
16 // CHECK: Nearest(0, 1) = 0
17 // CHECK: Nearest(0, 2) = 0
18 // CHECK: Nearest(0, 3) = 0
19 // CHECK: Nearest(0, 4) = 4
20 // CHECK: Nearest(1, 0) = 0
21 // CHECK: Nearest(1, 1) = 1
22 // CHECK: Nearest(1, 2) = 0
23 // CHECK: Nearest(1, 3) = 0
24 // CHECK: Nearest(1, 4) = 4
25 // CHECK: Nearest(2, 0) = 0
26 // CHECK: Nearest(2, 1) = 0
27 // CHECK: Nearest(2, 2) = 2
28 // CHECK: Nearest(2, 3) = 0
29 // CHECK: Nearest(2, 4) = 4
30 // CHECK: Nearest(3, 0) = 0
31 // CHECK: Nearest(3, 1) = 0
32 // CHECK: Nearest(3, 2) = 0
33 // CHECK: Nearest(3, 3) = 3
34 // CHECK: Nearest(3, 4) = 4
35 // CHECK: Nearest(4, 0) = 4
36 // CHECK: Nearest(4, 1) = 4
37 // CHECK: Nearest(4, 2) = 4
38 // CHECK: Nearest(4, 3) = 4
39 // CHECK: Nearest(4, 4) = 4
41 // CHECK: --- PostDominanceInfo ---
42 // CHECK: Nearest(0, 0) = 0
43 // CHECK: Nearest(0, 1) = 3
44 // CHECK: Nearest(0, 2) = 3
45 // CHECK: Nearest(0, 3) = 3
46 // CHECK: Nearest(0, 4) = 4
47 // CHECK: Nearest(1, 0) = 3
48 // CHECK: Nearest(1, 1) = 1
49 // CHECK: Nearest(1, 2) = 3
50 // CHECK: Nearest(1, 3) = 3
51 // CHECK: Nearest(1, 4) = 4
52 // CHECK: Nearest(2, 0) = 3
53 // CHECK: Nearest(2, 1) = 3
54 // CHECK: Nearest(2, 2) = 2
55 // CHECK: Nearest(2, 3) = 3
56 // CHECK: Nearest(2, 4) = 4
57 // CHECK: Nearest(3, 0) = 3
58 // CHECK: Nearest(3, 1) = 3
59 // CHECK: Nearest(3, 2) = 3
60 // CHECK: Nearest(3, 3) = 3
61 // CHECK: Nearest(3, 4) = 4
62 // CHECK: Nearest(4, 0) = 4
63 // CHECK: Nearest(4, 1) = 4
64 // CHECK: Nearest(4, 2) = 4
65 // CHECK: Nearest(4, 3) = 4
66 // CHECK: Nearest(4, 4) = 4
68 // CHECK: --- Block Dominance relationship ---
69 // CHECK: dominates(0, 0) = 1 (properly = 0)
70 // CHECK: dominates(0, 1) = 1 (properly = 1)
71 // CHECK: dominates(0, 2) = 1 (properly = 1)
72 // CHECK: dominates(0, 3) = 1 (properly = 1)
73 // CHECK: dominates(0, 4) = 0 (properly = 0)
74 // CHECK: dominates(1, 0) = 0 (properly = 0)
75 // CHECK: dominates(1, 1) = 1 (properly = 0)
76 // CHECK: dominates(1, 2) = 0 (properly = 0)
77 // CHECK: dominates(1, 3) = 0 (properly = 0)
78 // CHECK: dominates(1, 4) = 0 (properly = 0)
79 // CHECK: dominates(2, 0) = 0 (properly = 0)
80 // CHECK: dominates(2, 1) = 0 (properly = 0)
81 // CHECK: dominates(2, 2) = 1 (properly = 0)
82 // CHECK: dominates(2, 3) = 0 (properly = 0)
83 // CHECK: dominates(2, 4) = 0 (properly = 0)
84 // CHECK: dominates(3, 0) = 0 (properly = 0)
85 // CHECK: dominates(3, 1) = 0 (properly = 0)
86 // CHECK: dominates(3, 2) = 0 (properly = 0)
87 // CHECK: dominates(3, 3) = 1 (properly = 0)
88 // CHECK: dominates(3, 4) = 0 (properly = 0)
89 // CHECK: dominates(4, 0) = 1 (properly = 1)
90 // CHECK: dominates(4, 1) = 1 (properly = 1)
91 // CHECK: dominates(4, 2) = 1 (properly = 1)
92 // CHECK: dominates(4, 3) = 1 (properly = 1)
93 // CHECK: dominates(4, 4) = 1 (properly = 1)
95 // CHECK: --- Block PostDominance relationship ---
96 // CHECK: postdominates(0, 0) = 1 (properly = 0)
97 // CHECK: postdominates(0, 1) = 0 (properly = 0)
98 // CHECK: postdominates(0, 2) = 0 (properly = 0)
99 // CHECK: postdominates(0, 3) = 0 (properly = 0)
100 // CHECK: postdominates(0, 4) = 0 (properly = 0)
101 // CHECK: postdominates(1, 0) = 0 (properly = 0)
102 // CHECK: postdominates(1, 1) = 1 (properly = 0)
103 // CHECK: postdominates(1, 2) = 0 (properly = 0)
104 // CHECK: postdominates(1, 3) = 0 (properly = 0)
105 // CHECK: postdominates(1, 4) = 0 (properly = 0)
106 // CHECK: postdominates(2, 0) = 0 (properly = 0)
107 // CHECK: postdominates(2, 1) = 0 (properly = 0)
108 // CHECK: postdominates(2, 2) = 1 (properly = 0)
109 // CHECK: postdominates(2, 3) = 0 (properly = 0)
110 // CHECK: postdominates(2, 4) = 0 (properly = 0)
111 // CHECK: postdominates(3, 0) = 1 (properly = 1)
112 // CHECK: postdominates(3, 1) = 1 (properly = 1)
113 // CHECK: postdominates(3, 2) = 1 (properly = 1)
114 // CHECK: postdominates(3, 3) = 1 (properly = 0)
115 // CHECK: postdominates(3, 4) = 0 (properly = 0)
116 // CHECK: postdominates(4, 0) = 1 (properly = 1)
117 // CHECK: postdominates(4, 1) = 1 (properly = 1)
118 // CHECK: postdominates(4, 2) = 1 (properly = 1)
119 // CHECK: postdominates(4, 3) = 1 (properly = 1)
120 // CHECK: postdominates(4, 4) = 1 (properly = 1)
122 // CHECK: module attributes {test.block_ids = array<i64: 4>}
123 // CHECK: func.func @func_condBranch({{.*}}) attributes {test.block_ids = array<i64: 0, 1, 2, 3>}
127 // CHECK-LABEL: Testing : func_loop
128 func.func @func_loop(%arg0 : i32, %arg1 : i32) {
129 cf.br ^loopHeader(%arg0 : i32)
130 ^loopHeader(%counter : i32):
131 %lessThan = arith.cmpi slt, %counter, %arg1 : i32
132 cf.cond_br %lessThan, ^loopBody, ^exit
134 %const0 = arith.constant 1 : i32
135 %inc = arith.addi %counter, %const0 : i32
136 cf.br ^loopHeader(%inc : i32)
141 // CHECK: --- DominanceInfo ---
142 // CHECK: Nearest(0, 0) = 0
143 // CHECK: Nearest(0, 1) = 0
144 // CHECK: Nearest(0, 2) = 0
145 // CHECK: Nearest(0, 3) = 0
146 // CHECK: Nearest(0, 4) = 4
147 // CHECK: Nearest(1, 0) = 0
148 // CHECK: Nearest(1, 1) = 1
149 // CHECK: Nearest(1, 2) = 1
150 // CHECK: Nearest(1, 3) = 1
151 // CHECK: Nearest(1, 4) = 4
152 // CHECK: Nearest(2, 0) = 0
153 // CHECK: Nearest(2, 1) = 1
154 // CHECK: Nearest(2, 2) = 2
155 // CHECK: Nearest(2, 3) = 1
156 // CHECK: Nearest(2, 4) = 4
157 // CHECK: Nearest(3, 0) = 0
158 // CHECK: Nearest(3, 1) = 1
159 // CHECK: Nearest(3, 2) = 1
160 // CHECK: Nearest(3, 3) = 3
161 // CHECK: Nearest(3, 4) = 4
162 // CHECK: Nearest(4, 0) = 4
163 // CHECK: Nearest(4, 1) = 4
164 // CHECK: Nearest(4, 2) = 4
165 // CHECK: Nearest(4, 3) = 4
166 // CHECK: Nearest(4, 4) = 4
168 // CHECK: --- PostDominanceInfo ---
169 // CHECK: Nearest(0, 0) = 0
170 // CHECK: Nearest(0, 1) = 1
171 // CHECK: Nearest(0, 2) = 1
172 // CHECK: Nearest(0, 3) = 3
173 // CHECK: Nearest(0, 4) = 4
174 // CHECK: Nearest(1, 0) = 1
175 // CHECK: Nearest(1, 1) = 1
176 // CHECK: Nearest(1, 2) = 1
177 // CHECK: Nearest(1, 3) = 3
178 // CHECK: Nearest(1, 4) = 4
179 // CHECK: Nearest(2, 0) = 1
180 // CHECK: Nearest(2, 1) = 1
181 // CHECK: Nearest(2, 2) = 2
182 // CHECK: Nearest(2, 3) = 3
183 // CHECK: Nearest(2, 4) = 4
184 // CHECK: Nearest(3, 0) = 3
185 // CHECK: Nearest(3, 1) = 3
186 // CHECK: Nearest(3, 2) = 3
187 // CHECK: Nearest(3, 3) = 3
188 // CHECK: Nearest(3, 4) = 4
189 // CHECK: Nearest(4, 0) = 4
190 // CHECK: Nearest(4, 1) = 4
191 // CHECK: Nearest(4, 2) = 4
192 // CHECK: Nearest(4, 3) = 4
193 // CHECK: Nearest(4, 4) = 4
195 // CHECK: --- Block Dominance relationship ---
196 // CHECK: dominates(0, 0) = 1 (properly = 0)
197 // CHECK: dominates(0, 1) = 1 (properly = 1)
198 // CHECK: dominates(0, 2) = 1 (properly = 1)
199 // CHECK: dominates(0, 3) = 1 (properly = 1)
200 // CHECK: dominates(0, 4) = 0 (properly = 0)
201 // CHECK: dominates(1, 0) = 0 (properly = 0)
202 // CHECK: dominates(1, 1) = 1 (properly = 0)
203 // CHECK: dominates(1, 2) = 1 (properly = 1)
204 // CHECK: dominates(1, 3) = 1 (properly = 1)
205 // CHECK: dominates(1, 4) = 0 (properly = 0)
206 // CHECK: dominates(2, 0) = 0 (properly = 0)
207 // CHECK: dominates(2, 1) = 0 (properly = 0)
208 // CHECK: dominates(2, 2) = 1 (properly = 0)
209 // CHECK: dominates(2, 3) = 0 (properly = 0)
210 // CHECK: dominates(2, 4) = 0 (properly = 0)
211 // CHECK: dominates(3, 0) = 0 (properly = 0)
212 // CHECK: dominates(3, 1) = 0 (properly = 0)
213 // CHECK: dominates(3, 2) = 0 (properly = 0)
214 // CHECK: dominates(3, 3) = 1 (properly = 0)
215 // CHECK: dominates(3, 4) = 0 (properly = 0)
216 // CHECK: dominates(4, 0) = 1 (properly = 1)
217 // CHECK: dominates(4, 1) = 1 (properly = 1)
218 // CHECK: dominates(4, 2) = 1 (properly = 1)
219 // CHECK: dominates(4, 3) = 1 (properly = 1)
220 // CHECK: dominates(4, 4) = 1 (properly = 1)
222 // CHECK: --- Block PostDominance relationship ---
223 // CHECK: postdominates(0, 0) = 1 (properly = 0)
224 // CHECK: postdominates(0, 1) = 0 (properly = 0)
225 // CHECK: postdominates(0, 2) = 0 (properly = 0)
226 // CHECK: postdominates(0, 3) = 0 (properly = 0)
227 // CHECK: postdominates(0, 4) = 0 (properly = 0)
228 // CHECK: postdominates(1, 0) = 1 (properly = 1)
229 // CHECK: postdominates(1, 1) = 1 (properly = 0)
230 // CHECK: postdominates(1, 2) = 1 (properly = 1)
231 // CHECK: postdominates(1, 3) = 0 (properly = 0)
232 // CHECK: postdominates(1, 4) = 0 (properly = 0)
233 // CHECK: postdominates(2, 0) = 0 (properly = 0)
234 // CHECK: postdominates(2, 1) = 0 (properly = 0)
235 // CHECK: postdominates(2, 2) = 1 (properly = 0)
236 // CHECK: postdominates(2, 3) = 0 (properly = 0)
237 // CHECK: postdominates(2, 4) = 0 (properly = 0)
238 // CHECK: postdominates(3, 0) = 1 (properly = 1)
239 // CHECK: postdominates(3, 1) = 1 (properly = 1)
240 // CHECK: postdominates(3, 2) = 1 (properly = 1)
241 // CHECK: postdominates(3, 3) = 1 (properly = 0)
242 // CHECK: postdominates(3, 4) = 0 (properly = 0)
243 // CHECK: postdominates(4, 0) = 1 (properly = 1)
244 // CHECK: postdominates(4, 1) = 1 (properly = 1)
245 // CHECK: postdominates(4, 2) = 1 (properly = 1)
246 // CHECK: postdominates(4, 3) = 1 (properly = 1)
247 // CHECK: postdominates(4, 4) = 1 (properly = 1)
249 // CHECK: module attributes {test.block_ids = array<i64: 4>}
250 // CHECK: func.func @func_loop({{.*}}) attributes {test.block_ids = array<i64: 0, 1, 2, 3>}
254 // CHECK-LABEL: Testing : nested_region
255 func.func @nested_region(%arg0 : index, %arg1 : index, %arg2 : index) {
256 scf.for %arg3 = %arg0 to %arg1 step %arg2 { }
260 // CHECK: --- DominanceInfo ---
261 // CHECK: Nearest(0, 0) = 0
262 // CHECK: Nearest(0, 1) = 1
263 // CHECK: Nearest(0, 2) = 2
264 // CHECK: Nearest(1, 0) = 1
265 // CHECK: Nearest(1, 1) = 1
266 // CHECK: Nearest(1, 2) = 2
267 // CHECK: Nearest(2, 0) = 2
268 // CHECK: Nearest(2, 1) = 2
269 // CHECK: Nearest(2, 2) = 2
271 // CHECK: --- PostDominanceInfo ---
272 // CHECK: Nearest(0, 0) = 0
273 // CHECK: Nearest(0, 1) = 1
274 // CHECK: Nearest(0, 2) = 2
275 // CHECK: Nearest(1, 0) = 1
276 // CHECK: Nearest(1, 1) = 1
277 // CHECK: Nearest(1, 2) = 2
278 // CHECK: Nearest(2, 0) = 2
279 // CHECK: Nearest(2, 1) = 2
280 // CHECK: Nearest(2, 2) = 2
282 // CHECK: --- Block Dominance relationship ---
283 // CHECK: dominates(0, 0) = 1 (properly = 0)
284 // CHECK: dominates(0, 1) = 0 (properly = 0)
285 // CHECK: dominates(0, 2) = 0 (properly = 0)
286 // CHECK: dominates(1, 0) = 1 (properly = 1)
287 // CHECK: dominates(1, 1) = 1 (properly = 0)
288 // CHECK: dominates(1, 2) = 0 (properly = 0)
289 // CHECK: dominates(2, 0) = 1 (properly = 1)
290 // CHECK: dominates(2, 1) = 1 (properly = 1)
291 // CHECK: dominates(2, 2) = 1 (properly = 1)
293 // CHECK: --- Block PostDominance relationship ---
294 // CHECK: postdominates(0, 0) = 1 (properly = 0)
295 // CHECK: postdominates(0, 1) = 0 (properly = 0)
296 // CHECK: postdominates(0, 2) = 0 (properly = 0)
297 // CHECK: postdominates(1, 0) = 1 (properly = 1)
298 // CHECK: postdominates(1, 1) = 1 (properly = 0)
299 // CHECK: postdominates(1, 2) = 0 (properly = 0)
300 // CHECK: postdominates(2, 0) = 1 (properly = 1)
301 // CHECK: postdominates(2, 1) = 1 (properly = 1)
302 // CHECK: postdominates(2, 2) = 1 (properly = 1)
304 // CHECK: module attributes {test.block_ids = array<i64: 2>} {
305 // CHECK: func.func @nested_region({{.*}}) attributes {test.block_ids = array<i64: 1>} {
306 // CHECK: scf.for {{.*}} {
307 // CHECK: } {test.block_ids = array<i64: 0>}
314 // CHECK-LABEL: Testing : nested_region2
315 func.func @nested_region2(%arg0 : index, %arg1 : index, %arg2 : index) {
316 scf.for %arg3 = %arg0 to %arg1 step %arg2 {
317 scf.for %arg4 = %arg0 to %arg1 step %arg2 {
318 scf.for %arg5 = %arg0 to %arg1 step %arg2 { }
324 // CHECK: --- DominanceInfo ---
325 // CHECK: Nearest(0, 0) = 0
326 // CHECK: Nearest(0, 1) = 1
327 // CHECK: Nearest(0, 2) = 2
328 // CHECK: Nearest(0, 3) = 3
329 // CHECK: Nearest(0, 4) = 4
330 // CHECK: Nearest(1, 0) = 1
331 // CHECK: Nearest(1, 1) = 1
332 // CHECK: Nearest(1, 2) = 2
333 // CHECK: Nearest(1, 3) = 3
334 // CHECK: Nearest(1, 4) = 4
335 // CHECK: Nearest(2, 0) = 2
336 // CHECK: Nearest(2, 1) = 2
337 // CHECK: Nearest(2, 2) = 2
338 // CHECK: Nearest(2, 3) = 3
339 // CHECK: Nearest(2, 4) = 4
340 // CHECK: Nearest(3, 0) = 3
341 // CHECK: Nearest(3, 1) = 3
342 // CHECK: Nearest(3, 2) = 3
343 // CHECK: Nearest(3, 3) = 3
344 // CHECK: Nearest(3, 4) = 4
345 // CHECK: Nearest(4, 0) = 4
346 // CHECK: Nearest(4, 1) = 4
347 // CHECK: Nearest(4, 2) = 4
348 // CHECK: Nearest(4, 3) = 4
349 // CHECK: Nearest(4, 4) = 4
351 // CHECK: --- PostDominanceInfo ---
352 // CHECK: Nearest(0, 0) = 0
353 // CHECK: Nearest(0, 1) = 1
354 // CHECK: Nearest(0, 2) = 2
355 // CHECK: Nearest(0, 3) = 3
356 // CHECK: Nearest(0, 4) = 4
357 // CHECK: Nearest(1, 0) = 1
358 // CHECK: Nearest(1, 1) = 1
359 // CHECK: Nearest(1, 2) = 2
360 // CHECK: Nearest(1, 3) = 3
361 // CHECK: Nearest(1, 4) = 4
362 // CHECK: Nearest(2, 0) = 2
363 // CHECK: Nearest(2, 1) = 2
364 // CHECK: Nearest(2, 2) = 2
365 // CHECK: Nearest(2, 3) = 3
366 // CHECK: Nearest(2, 4) = 4
367 // CHECK: Nearest(3, 0) = 3
368 // CHECK: Nearest(3, 1) = 3
369 // CHECK: Nearest(3, 2) = 3
370 // CHECK: Nearest(3, 3) = 3
371 // CHECK: Nearest(3, 4) = 4
372 // CHECK: Nearest(4, 0) = 4
373 // CHECK: Nearest(4, 1) = 4
374 // CHECK: Nearest(4, 2) = 4
375 // CHECK: Nearest(4, 3) = 4
376 // CHECK: Nearest(4, 4) = 4
378 // CHECK: --- Block Dominance relationship ---
379 // CHECK: dominates(0, 0) = 1 (properly = 0)
380 // CHECK: dominates(0, 1) = 0 (properly = 0)
381 // CHECK: dominates(0, 2) = 0 (properly = 0)
382 // CHECK: dominates(0, 3) = 0 (properly = 0)
383 // CHECK: dominates(0, 4) = 0 (properly = 0)
384 // CHECK: dominates(1, 0) = 1 (properly = 1)
385 // CHECK: dominates(1, 1) = 1 (properly = 0)
386 // CHECK: dominates(1, 2) = 0 (properly = 0)
387 // CHECK: dominates(1, 3) = 0 (properly = 0)
388 // CHECK: dominates(1, 4) = 0 (properly = 0)
389 // CHECK: dominates(2, 0) = 1 (properly = 1)
390 // CHECK: dominates(2, 1) = 1 (properly = 1)
391 // CHECK: dominates(2, 2) = 1 (properly = 0)
392 // CHECK: dominates(2, 3) = 0 (properly = 0)
393 // CHECK: dominates(2, 4) = 0 (properly = 0)
394 // CHECK: dominates(3, 0) = 1 (properly = 1)
395 // CHECK: dominates(3, 1) = 1 (properly = 1)
396 // CHECK: dominates(3, 2) = 1 (properly = 1)
397 // CHECK: dominates(3, 3) = 1 (properly = 0)
398 // CHECK: dominates(3, 4) = 0 (properly = 0)
399 // CHECK: dominates(4, 0) = 1 (properly = 1)
400 // CHECK: dominates(4, 1) = 1 (properly = 1)
401 // CHECK: dominates(4, 2) = 1 (properly = 1)
402 // CHECK: dominates(4, 3) = 1 (properly = 1)
403 // CHECK: dominates(4, 4) = 1 (properly = 1)
405 // CHECK: --- Block PostDominance relationship ---
406 // CHECK: postdominates(0, 0) = 1 (properly = 0)
407 // CHECK: postdominates(0, 1) = 0 (properly = 0)
408 // CHECK: postdominates(0, 2) = 0 (properly = 0)
409 // CHECK: postdominates(0, 3) = 0 (properly = 0)
410 // CHECK: postdominates(0, 4) = 0 (properly = 0)
411 // CHECK: postdominates(1, 0) = 1 (properly = 1)
412 // CHECK: postdominates(1, 1) = 1 (properly = 0)
413 // CHECK: postdominates(1, 2) = 0 (properly = 0)
414 // CHECK: postdominates(1, 3) = 0 (properly = 0)
415 // CHECK: postdominates(1, 4) = 0 (properly = 0)
416 // CHECK: postdominates(2, 0) = 1 (properly = 1)
417 // CHECK: postdominates(2, 1) = 1 (properly = 1)
418 // CHECK: postdominates(2, 2) = 1 (properly = 0)
419 // CHECK: postdominates(2, 3) = 0 (properly = 0)
420 // CHECK: postdominates(2, 4) = 0 (properly = 0)
421 // CHECK: postdominates(3, 0) = 1 (properly = 1)
422 // CHECK: postdominates(3, 1) = 1 (properly = 1)
423 // CHECK: postdominates(3, 2) = 1 (properly = 1)
424 // CHECK: postdominates(3, 3) = 1 (properly = 0)
425 // CHECK: postdominates(3, 4) = 0 (properly = 0)
426 // CHECK: postdominates(4, 0) = 1 (properly = 1)
427 // CHECK: postdominates(4, 1) = 1 (properly = 1)
428 // CHECK: postdominates(4, 2) = 1 (properly = 1)
429 // CHECK: postdominates(4, 3) = 1 (properly = 1)
430 // CHECK: postdominates(4, 4) = 1 (properly = 1)
432 // CHECK: module attributes {test.block_ids = array<i64: 4>} {
433 // CHECK: func.func @nested_region2({{.*}}) attributes {test.block_ids = array<i64: 3>} {
434 // CHECK: scf.for {{.*}} {
435 // CHECK: scf.for {{.*}} {
436 // CHECK: scf.for {{.*}} {
437 // CHECK: } {test.block_ids = array<i64: 0>}
438 // CHECK: } {test.block_ids = array<i64: 1>}
439 // CHECK: } {test.block_ids = array<i64: 2>}
446 // CHECK-LABEL: Testing : func_loop_nested_region
447 func.func @func_loop_nested_region(
453 cf.br ^loopHeader(%arg0 : i32)
454 ^loopHeader(%counter : i32):
455 %lessThan = arith.cmpi slt, %counter, %arg1 : i32
456 cf.cond_br %lessThan, ^loopBody, ^exit
458 %const0 = arith.constant 1 : i32
459 %inc = arith.addi %counter, %const0 : i32
460 scf.for %arg5 = %arg2 to %arg3 step %arg4 {
461 scf.for %arg6 = %arg2 to %arg3 step %arg4 { }
463 cf.br ^loopHeader(%inc : i32)
468 // CHECK: --- DominanceInfo ---
469 // CHECK: Nearest(0, 0) = 0
470 // CHECK: Nearest(0, 1) = 0
471 // CHECK: Nearest(0, 2) = 0
472 // CHECK: Nearest(0, 3) = 0
473 // CHECK: Nearest(0, 4) = 0
474 // CHECK: Nearest(0, 5) = 0
475 // CHECK: Nearest(0, 6) = 6
476 // CHECK: Nearest(1, 0) = 0
477 // CHECK: Nearest(1, 1) = 1
478 // CHECK: Nearest(1, 2) = 1
479 // CHECK: Nearest(1, 3) = 1
480 // CHECK: Nearest(1, 4) = 1
481 // CHECK: Nearest(1, 5) = 1
482 // CHECK: Nearest(1, 6) = 6
483 // CHECK: Nearest(2, 0) = 0
484 // CHECK: Nearest(2, 1) = 1
485 // CHECK: Nearest(2, 2) = 2
486 // CHECK: Nearest(2, 3) = 2
487 // CHECK: Nearest(2, 4) = 2
488 // CHECK: Nearest(2, 5) = 1
489 // CHECK: Nearest(2, 6) = 6
490 // CHECK: Nearest(3, 0) = 0
491 // CHECK: Nearest(3, 1) = 1
492 // CHECK: Nearest(3, 2) = 2
493 // CHECK: Nearest(3, 3) = 3
494 // CHECK: Nearest(3, 4) = 4
495 // CHECK: Nearest(3, 5) = 1
496 // CHECK: Nearest(3, 6) = 6
497 // CHECK: Nearest(4, 0) = 0
498 // CHECK: Nearest(4, 1) = 1
499 // CHECK: Nearest(4, 2) = 2
500 // CHECK: Nearest(4, 3) = 4
501 // CHECK: Nearest(4, 4) = 4
502 // CHECK: Nearest(4, 5) = 1
503 // CHECK: Nearest(4, 6) = 6
504 // CHECK: Nearest(5, 0) = 0
505 // CHECK: Nearest(5, 1) = 1
506 // CHECK: Nearest(5, 2) = 1
507 // CHECK: Nearest(5, 3) = 1
508 // CHECK: Nearest(5, 4) = 1
509 // CHECK: Nearest(5, 5) = 5
510 // CHECK: Nearest(5, 6) = 6
511 // CHECK: Nearest(6, 0) = 6
512 // CHECK: Nearest(6, 1) = 6
513 // CHECK: Nearest(6, 2) = 6
514 // CHECK: Nearest(6, 3) = 6
515 // CHECK: Nearest(6, 4) = 6
516 // CHECK: Nearest(6, 5) = 6
517 // CHECK: Nearest(6, 6) = 6
519 // CHECK: --- PostDominanceInfo ---
520 // CHECK: Nearest(0, 0) = 0
521 // CHECK: Nearest(0, 1) = 1
522 // CHECK: Nearest(0, 2) = 1
523 // CHECK: Nearest(0, 3) = 1
524 // CHECK: Nearest(0, 4) = 1
525 // CHECK: Nearest(0, 5) = 5
526 // CHECK: Nearest(0, 6) = 6
527 // CHECK: Nearest(1, 0) = 1
528 // CHECK: Nearest(1, 1) = 1
529 // CHECK: Nearest(1, 2) = 1
530 // CHECK: Nearest(1, 3) = 1
531 // CHECK: Nearest(1, 4) = 1
532 // CHECK: Nearest(1, 5) = 5
533 // CHECK: Nearest(1, 6) = 6
534 // CHECK: Nearest(2, 0) = 1
535 // CHECK: Nearest(2, 1) = 1
536 // CHECK: Nearest(2, 2) = 2
537 // CHECK: Nearest(2, 3) = 2
538 // CHECK: Nearest(2, 4) = 2
539 // CHECK: Nearest(2, 5) = 5
540 // CHECK: Nearest(2, 6) = 6
541 // CHECK: Nearest(3, 0) = 1
542 // CHECK: Nearest(3, 1) = 1
543 // CHECK: Nearest(3, 2) = 2
544 // CHECK: Nearest(3, 3) = 3
545 // CHECK: Nearest(3, 4) = 4
546 // CHECK: Nearest(3, 5) = 5
547 // CHECK: Nearest(3, 6) = 6
548 // CHECK: Nearest(4, 0) = 1
549 // CHECK: Nearest(4, 1) = 1
550 // CHECK: Nearest(4, 2) = 2
551 // CHECK: Nearest(4, 3) = 4
552 // CHECK: Nearest(4, 4) = 4
553 // CHECK: Nearest(4, 5) = 5
554 // CHECK: Nearest(4, 6) = 6
555 // CHECK: Nearest(5, 0) = 5
556 // CHECK: Nearest(5, 1) = 5
557 // CHECK: Nearest(5, 2) = 5
558 // CHECK: Nearest(5, 3) = 5
559 // CHECK: Nearest(5, 4) = 5
560 // CHECK: Nearest(5, 5) = 5
561 // CHECK: Nearest(5, 6) = 6
562 // CHECK: Nearest(6, 0) = 6
563 // CHECK: Nearest(6, 1) = 6
564 // CHECK: Nearest(6, 2) = 6
565 // CHECK: Nearest(6, 3) = 6
566 // CHECK: Nearest(6, 4) = 6
567 // CHECK: Nearest(6, 5) = 6
568 // CHECK: Nearest(6, 6) = 6
570 // CHECK: --- Block Dominance relationship ---
571 // CHECK: dominates(0, 0) = 1 (properly = 0)
572 // CHECK: dominates(0, 1) = 1 (properly = 1)
573 // CHECK: dominates(0, 2) = 1 (properly = 1)
574 // CHECK: dominates(0, 3) = 1 (properly = 1)
575 // CHECK: dominates(0, 4) = 1 (properly = 1)
576 // CHECK: dominates(0, 5) = 1 (properly = 1)
577 // CHECK: dominates(0, 6) = 0 (properly = 0)
578 // CHECK: dominates(1, 0) = 0 (properly = 0)
579 // CHECK: dominates(1, 1) = 1 (properly = 0)
580 // CHECK: dominates(1, 2) = 1 (properly = 1)
581 // CHECK: dominates(1, 3) = 1 (properly = 1)
582 // CHECK: dominates(1, 4) = 1 (properly = 1)
583 // CHECK: dominates(1, 5) = 1 (properly = 1)
584 // CHECK: dominates(1, 6) = 0 (properly = 0)
585 // CHECK: dominates(2, 0) = 0 (properly = 0)
586 // CHECK: dominates(2, 1) = 0 (properly = 0)
587 // CHECK: dominates(2, 2) = 1 (properly = 0)
588 // CHECK: dominates(2, 3) = 1 (properly = 1)
589 // CHECK: dominates(2, 4) = 1 (properly = 1)
590 // CHECK: dominates(2, 5) = 0 (properly = 0)
591 // CHECK: dominates(2, 6) = 0 (properly = 0)
592 // CHECK: dominates(3, 0) = 0 (properly = 0)
593 // CHECK: dominates(3, 1) = 0 (properly = 0)
594 // CHECK: dominates(3, 2) = 0 (properly = 0)
595 // CHECK: dominates(3, 3) = 1 (properly = 0)
596 // CHECK: dominates(3, 4) = 0 (properly = 0)
597 // CHECK: dominates(3, 5) = 0 (properly = 0)
598 // CHECK: dominates(3, 6) = 0 (properly = 0)
599 // CHECK: dominates(4, 0) = 0 (properly = 0)
600 // CHECK: dominates(4, 1) = 0 (properly = 0)
601 // CHECK: dominates(4, 2) = 0 (properly = 0)
602 // CHECK: dominates(4, 3) = 1 (properly = 1)
603 // CHECK: dominates(4, 4) = 1 (properly = 0)
604 // CHECK: dominates(4, 5) = 0 (properly = 0)
605 // CHECK: dominates(4, 6) = 0 (properly = 0)
606 // CHECK: dominates(5, 0) = 0 (properly = 0)
607 // CHECK: dominates(5, 1) = 0 (properly = 0)
608 // CHECK: dominates(5, 2) = 0 (properly = 0)
609 // CHECK: dominates(5, 3) = 0 (properly = 0)
610 // CHECK: dominates(5, 4) = 0 (properly = 0)
611 // CHECK: dominates(5, 5) = 1 (properly = 0)
612 // CHECK: dominates(5, 6) = 0 (properly = 0)
613 // CHECK: dominates(6, 0) = 1 (properly = 1)
614 // CHECK: dominates(6, 1) = 1 (properly = 1)
615 // CHECK: dominates(6, 2) = 1 (properly = 1)
616 // CHECK: dominates(6, 3) = 1 (properly = 1)
617 // CHECK: dominates(6, 4) = 1 (properly = 1)
618 // CHECK: dominates(6, 5) = 1 (properly = 1)
619 // CHECK: dominates(6, 6) = 1 (properly = 1)
621 // CHECK: --- Block PostDominance relationship ---
622 // CHECK: postdominates(0, 0) = 1 (properly = 0)
623 // CHECK: postdominates(0, 1) = 0 (properly = 0)
624 // CHECK: postdominates(0, 2) = 0 (properly = 0)
625 // CHECK: postdominates(0, 3) = 0 (properly = 0)
626 // CHECK: postdominates(0, 4) = 0 (properly = 0)
627 // CHECK: postdominates(0, 5) = 0 (properly = 0)
628 // CHECK: postdominates(0, 6) = 0 (properly = 0)
629 // CHECK: postdominates(1, 0) = 1 (properly = 1)
630 // CHECK: postdominates(1, 1) = 1 (properly = 0)
631 // CHECK: postdominates(1, 2) = 1 (properly = 1)
632 // CHECK: postdominates(1, 3) = 1 (properly = 1)
633 // CHECK: postdominates(1, 4) = 1 (properly = 1)
634 // CHECK: postdominates(1, 5) = 0 (properly = 0)
635 // CHECK: postdominates(1, 6) = 0 (properly = 0)
636 // CHECK: postdominates(2, 0) = 0 (properly = 0)
637 // CHECK: postdominates(2, 1) = 0 (properly = 0)
638 // CHECK: postdominates(2, 2) = 1 (properly = 0)
639 // CHECK: postdominates(2, 3) = 1 (properly = 1)
640 // CHECK: postdominates(2, 4) = 1 (properly = 1)
641 // CHECK: postdominates(2, 5) = 0 (properly = 0)
642 // CHECK: postdominates(2, 6) = 0 (properly = 0)
643 // CHECK: postdominates(3, 0) = 0 (properly = 0)
644 // CHECK: postdominates(3, 1) = 0 (properly = 0)
645 // CHECK: postdominates(3, 2) = 0 (properly = 0)
646 // CHECK: postdominates(3, 3) = 1 (properly = 0)
647 // CHECK: postdominates(3, 4) = 0 (properly = 0)
648 // CHECK: postdominates(3, 5) = 0 (properly = 0)
649 // CHECK: postdominates(3, 6) = 0 (properly = 0)
650 // CHECK: postdominates(4, 0) = 0 (properly = 0)
651 // CHECK: postdominates(4, 1) = 0 (properly = 0)
652 // CHECK: postdominates(4, 2) = 0 (properly = 0)
653 // CHECK: postdominates(4, 3) = 1 (properly = 1)
654 // CHECK: postdominates(4, 4) = 1 (properly = 0)
655 // CHECK: postdominates(4, 5) = 0 (properly = 0)
656 // CHECK: postdominates(4, 6) = 0 (properly = 0)
657 // CHECK: postdominates(5, 0) = 1 (properly = 1)
658 // CHECK: postdominates(5, 1) = 1 (properly = 1)
659 // CHECK: postdominates(5, 2) = 1 (properly = 1)
660 // CHECK: postdominates(5, 3) = 1 (properly = 1)
661 // CHECK: postdominates(5, 4) = 1 (properly = 1)
662 // CHECK: postdominates(5, 5) = 1 (properly = 0)
663 // CHECK: postdominates(5, 6) = 0 (properly = 0)
664 // CHECK: postdominates(6, 0) = 1 (properly = 1)
665 // CHECK: postdominates(6, 1) = 1 (properly = 1)
666 // CHECK: postdominates(6, 2) = 1 (properly = 1)
667 // CHECK: postdominates(6, 3) = 1 (properly = 1)
668 // CHECK: postdominates(6, 4) = 1 (properly = 1)
669 // CHECK: postdominates(6, 5) = 1 (properly = 1)
670 // CHECK: postdominates(6, 6) = 1 (properly = 1)
672 // CHECK: module attributes {test.block_ids = array<i64: 6>} {
673 // CHECK: func.func @func_loop_nested_region({{.*}}) attributes {test.block_ids = array<i64: 0, 1, 2, 5>} {
676 // CHECK: scf.for {{.*}} {
677 // CHECK: scf.for {{.*}} {
678 // CHECK: } {test.block_ids = array<i64: 3>}
679 // CHECK: } {test.block_ids = array<i64: 4>}