Mark the jump_table_entry Instruction as loading;

This commit is contained in:
Benjamin Bouvier
2019-06-26 17:10:20 +02:00
parent 079ccf1f6e
commit 83336290c2
3 changed files with 32 additions and 2 deletions

View File

@@ -0,0 +1,29 @@
test licm
target x86_64
function %dont_hoist_jump_table_entry_during_licm() {
jt0 = jump_table [ebb1, ebb1]
ebb0:
fallthrough ebb1
ebb1: ; the loop!
v2 = iconst.i32 42
v3 = ifcmp_imm v2, 0
brif uge v3, ebb1
fallthrough ebb2
ebb2:
v1 = iconst.i32 -14
v8 = ifcmp_imm v1, 2
brif uge v8, ebb1
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: ebb2:
; nextln: v8 = ifcmp_imm.i32 v1, 2
; nextln: brif uge v8, ebb1
; nextln: jump_table_entry.i64
}