Files
wasmtime/cranelift/filetests/filetests/licm/rewrite-jump-table.clif
Afonso Bordado af62037f62 cranelift: Restrict br_table to i32 indices (#4510)
* cranelift: Restrict `br_table` to `i32` indices

In #4498 it was proposed that we should only accept `i32` indices
to `br_table`. The rationale for this is that larger types lead the
users to a false sense of flexibility (since we don't support jump
tables larger than u32's), and narrower types are not well tested
paths that would be safer if we removed them.

* cranelift: Reduce directly from i128 to i32 in Switch
2022-07-22 23:32:40 +00:00

26 lines
434 B
Plaintext

test licm
target aarch64
function %rewrite_jump_table() {
jt0 = jump_table [block1, block2]
block0:
v0 = iconst.i32 1
br_table v0, block1, jt0
block1:
return
block2:
v4 = bconst.b1 false
jump block2
}
; sameln: function
; nextln: jt0 = jump_table [block1, block3]
; check: block3:
; nextln: v4 = bconst.b1 false
; nextln: jump block2
; check: block2:
; nextln: jump block2