Remove instructions used by old br_table legalization

This commit is contained in:
bjorn3
2021-10-12 14:18:52 +02:00
parent 783bb1f759
commit 5b24e117ee
14 changed files with 4 additions and 198 deletions

View File

@@ -1,34 +0,0 @@
test licm
target aarch64
target x86_64
function %dont_hoist_jump_table_entry_during_licm() {
jt0 = jump_table [block1, block1]
block0:
fallthrough block1
block1: ; the loop!
v2 = iconst.i32 42
v3 = ifcmp_imm v2, 0
brif uge v3, block1
fallthrough block2
block2:
v1 = iconst.i64 -14
v8 = ifcmp_imm v1, 2
brif uge v8, block1
jump block3
block3:
v5 = jump_table_base.i64 jt0
v6 = jump_table_entry.i64 v1, v5, 4, jt0
v7 = iadd v5, v6
indirect_jump_table_br v7, jt0
; check: block2:
; nextln: v8 = ifcmp_imm.i64 v1, 2
; nextln: brif uge v8, block1
; nextln: jump block3
; check: block3:
; nextln: jump_table_entry.i64
}

View File

@@ -6,10 +6,7 @@ function %rewrite_jump_table() {
block0:
v0 = iconst.i64 1
v1 = jump_table_base.i64 jt0
v2 = jump_table_entry.i64 v0, v1, 4, jt0
v3 = iadd v1, v2
indirect_jump_table_br v3, jt0
br_table v0, block1, jt0
block1:
return