Files
wasmtime/cranelift/filetests/filetests/isa/x86/legalize-tables.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

74 lines
2.7 KiB
Plaintext

test legalizer
target x86_64
; Test legalization for various forms of table addresses.
; regex: BB=block\d+
function %table_addrs(i32, i64, i64 vmctx) {
gv4 = vmctx
gv0 = iadd_imm.i64 gv4, 72
gv1 = iadd_imm.i64 gv4, 80
gv2 = load.i32 notrap aligned gv4+88
table0 = dynamic gv0, min 0x1_0000, bound gv2, element_size 1, index_type i32
table1 = dynamic gv0, bound gv2, element_size 16, index_type i32
table2 = dynamic gv0, min 0x1_0000, bound gv1, element_size 1, index_type i64
table3 = dynamic gv0, bound gv1, element_size 16, index_type i64
; check: table0 = dynamic gv0, min 0x0001_0000, bound gv2, element_size 1, index_type i32
; check: table1 = dynamic gv0, min 0, bound gv2, element_size 16, index_type i32
; check: table2 = dynamic gv0, min 0x0001_0000, bound gv1, element_size 1, index_type i64
; check: table3 = dynamic gv0, min 0, bound gv1, element_size 16, index_type i64
block0(v0: i32, v1: i64, v3: i64):
v4 = table_addr.i64 table0, v0, +0
; check: v8 = load.i32 notrap aligned v3+88
; check: v9 = icmp uge v0, v8
; check: brz v9, $(resume_1=$BB)
; nextln: jump $(trap_1=$BB)
; check: $trap_1:
; nextln: trap table_oob
; check: $resume_1:
; check: v10 = uextend.i64 v0
; check: v11 = iadd_imm.i64 v3, 72
; check: v4 = iadd v11, v10
v5 = table_addr.i64 table1, v0, +0
; check: v12 = load.i32 notrap aligned v3+88
; check: v13 = icmp.i32 uge v0, v12
; check: brz v13, $(resume_2=$BB)
; nextln: jump $(trap_2=$BB)
; check: $trap_2:
; nextln: trap table_oob
; check: $resume_2:
; check: v14 = uextend.i64 v0
; check: v15 = iadd_imm.i64 v3, 72
; check: v16 = ishl_imm v14, 4
; check: v5 = iadd v15, v16
v6 = table_addr.i64 table2, v1, +0
; check: v17 = iadd_imm.i64 v3, 80
; check: v18 = icmp.i64 uge v1, v17
; check: brz v18, $(resume_3=$BB)
; nextln: jump $(trap_3=$BB)
; check: $trap_3:
; nextln: trap table_oob
; check: $resume_3:
; check: v19 = iadd_imm.i64 v3, 72
; check: v6 = iadd v19, v1
v7 = table_addr.i64 table3, v1, +0
; check: v20 = iadd_imm.i64 v3, 80
; check: v21 = icmp.i64 uge v1, v20
; check: brz v21, $(resume_4=$BB)
; nextln: jump $(trap_4=$BB)
; check: $trap_4:
; nextln: trap table_oob
; check: $resume_4:
; check: v22 = iadd_imm.i64 v3, 72
; check: v23 = ishl_imm.i64 v1, 4
; check: v7 = iadd v22, v23
return
}