Files
wasmtime/cranelift/filetests/filetests/domtree/loops2.clif
Trevor Elliott 8abfe928d6 Reuse the DominatorTree postorder travesal in BlockLoweringOrder (#5843)
* Rework the blockorder module to reuse the dom tree's cfg postorder

* Update domtree tests

* Treat br_table with an empty jump table as multiple block exits

* Bless tests

* Change branch_idx to succ_idx and fix the comment
2023-02-23 22:05:20 +00:00

82 lines
1.8 KiB
Plaintext

test domtree
function %loop1(i32) {
block0(v0: i32):
brif v0, block10, block1 ; dominates: block10 block1 block6
block10:
brif v0, block2, block3 ; dominates: block2 block9 block3
block1:
jump block6
block2:
brif v0, block5, block4 ; dominates: block5 block4 block7 block8
block3:
jump block9
block4:
brif v0, block11, block4 ; dominates: block11
block11:
brif v0, block6, block7
block5:
brif v0, block12, block7 ; dominates: block12
block12:
brif v0, block8, block9
block6:
return
block7:
jump block8
block8:
return
block9:
return
}
; check: domtree_preorder {
; nextln: block0: block1 block10 block6
; nextln: block1:
; nextln: block10: block3 block2 block9
; nextln: block3:
; nextln: block2: block4 block5 block7 block8
; nextln: block4: block11
; nextln: block11:
; nextln: block5: block12
; nextln: block12:
; nextln: block7:
; nextln: block8:
; nextln: block9:
; nextln: block6:
; nextln: }
function %loop2(i32) system_v {
block0(v0: i32):
brif v0, block2, block1 ; dominates: block2 block1 block3 block4 block5
block1:
jump block3
block2:
brif v0, block5, block4
block3:
jump block4
block4:
brif v0, block5, block3
block5:
brif v0, block6, block4 ; dominates: block6
block6:
return
}
; check: cfg_postorder:
; sameln: block6
; sameln: block3
; sameln: block4
; sameln: block5
; sameln: block2
; sameln: block1
; sameln: block0
; check: domtree_preorder {
; nextln: block0: block1 block2 block5 block4 block3
; nextln: block1:
; nextln: block2:
; nextln: block5: block6
; nextln: block6:
; nextln: block4:
; nextln: block3:
; nextln: }