Files
wasmtime/cranelift/filetests/filetests/legalizer/br_table_cond.clif
Ryan Hunt 832666c45e Mass rename Ebb and relatives to Block (#1365)
* Manually rename BasicBlock to BlockPredecessor

BasicBlock is a pair of (Ebb, Inst) that is used to represent the
basic block subcomponent of an Ebb that is a predecessor to an Ebb.

Eventually we will be able to remove this struct, but for now it
makes sense to give it a non-conflicting name so that we can start
to transition Ebb to represent a basic block.

I have not updated any comments that refer to BasicBlock, as
eventually we will remove BlockPredecessor and replace with Block,
which is a basic block, so the comments will become correct.

* Manually rename SSABuilder block types to avoid conflict

SSABuilder has its own Block and BlockData types. These along with
associated identifier will cause conflicts in a later commit, so
they are renamed to be more verbose here.

* Automatically rename 'Ebb' to 'Block' in *.rs

* Automatically rename 'EBB' to 'block' in *.rs

* Automatically rename 'ebb' to 'block' in *.rs

* Automatically rename 'extended basic block' to 'basic block' in *.rs

* Automatically rename 'an basic block' to 'a basic block' in *.rs

* Manually update comment for `Block`

`Block`'s wikipedia article required an update.

* Automatically rename 'an `Block`' to 'a `Block`' in *.rs

* Automatically rename 'extended_basic_block' to 'basic_block' in *.rs

* Automatically rename 'ebb' to 'block' in *.clif

* Manually rename clif constant that contains 'ebb' as substring to avoid conflict

* Automatically rename filecheck uses of 'EBB' to 'BB'

'regex: EBB' -> 'regex: BB'
'$EBB' -> '$BB'

* Automatically rename 'EBB' 'Ebb' to 'block' in *.clif

* Automatically rename 'an block' to 'a block' in *.clif

* Fix broken testcase when function name length increases

Test function names are limited to 16 characters. This causes
the new longer name to be truncated and fail a filecheck test. An
outdated comment was also fixed.
2020-02-07 10:46:47 -06:00

65 lines
1.4 KiB
Plaintext

test legalizer
set enable_probestack=false
set enable_jump_tables=false
target x86_64
; Test that when jump_tables_enables is false, all jump tables are eliminated.
; regex: V=v\d+
; regex: BB=block\d+
function u0:0(i64 vmctx) baldrdash_system_v {
gv0 = vmctx
gv1 = iadd_imm.i64 gv0, 48
jt0 = jump_table [block2, block2, block7]
jt1 = jump_table [block8, block8]
block0(v0: i64):
jump block5
block5:
v1 = global_value.i64 gv1
v2 = load.i64 v1
trapnz v2, interrupt
v3 = iconst.i32 0
br_table v3, block3, jt0
; check: block5:
; check: $(val0=$V) = iconst.i32 0
; nextln: $(cmp0=$V) = icmp_imm eq $val0, 0
; nextln: brnz $cmp0, block2
; nextln: jump $(fail0=$BB)
; check: $fail0:
; nextln: $(cmp1=$V) = icmp_imm.i32 eq $val0, 1
; nextln: brnz $cmp1, block2
; nextln: jump $(fail1=$BB)
; check: $fail1:
; nextln: $(cmp2=$V) = icmp_imm.i32 eq $val0, 2
; nextln: brnz $cmp2, block7
; nextln: jump block3
block7:
v4 = iconst.i32 0
br_table v4, block3, jt1
; check: block7:
; check: $(val1=$V) = iconst.i32 0
; nextln: $(cmp3=$V) = icmp_imm eq $val1, 0
; nextln: brnz $cmp3, block8
; nextln: jump $(fail3=$BB)
; check: $fail3:
; nextln: $(cmp4=$V) = icmp_imm.i32 eq $val1, 1
; nextln: brnz $cmp4, block8
; nextln: jump block3
block8:
jump block5
block3:
jump block2
block2:
jump block1
block1:
fallthrough_return
}
; not: jump_table