Legalize br_table to a BB-like format.
This commit is contained in:
committed by
GitHub
parent
1963c223b1
commit
3ac7466cab
@@ -1,6 +1,8 @@
|
||||
test compile
|
||||
|
||||
target x86_64
|
||||
; regex: V=v\d+
|
||||
; regex: EBB=ebb\d+
|
||||
|
||||
function u0:0(i64) system_v {
|
||||
ss0 = explicit_slot 1
|
||||
@@ -10,6 +12,14 @@ ebb0(v0: i64):
|
||||
v1 = stack_addr.i64 ss0
|
||||
v2 = load.i8 v1
|
||||
br_table v2, ebb2, jt0
|
||||
; check: $(oob=$V) = ifcmp_imm $(idx=$V), 1
|
||||
; nextln: brif uge $oob, ebb2
|
||||
; nextln: fallthrough $(inb=$EBB)
|
||||
; check: $inb:
|
||||
; nextln: $(base=$V) = jump_table_base.i64 jt0
|
||||
; nextln: $(rel_addr=$V) = jump_table_entry.i64 $idx, $base, 4, jt0
|
||||
; nextln: $(addr=$V) = iadd $base, $rel_addr
|
||||
; nextln: indirect_jump_table_br $addr, jt0
|
||||
|
||||
ebb2:
|
||||
jump ebb1
|
||||
|
||||
Reference in New Issue
Block a user