Write and parse value locations for EBB arguments
Fixes #56. We now have complete support for value location annotations in the textual IL format. Values defined by instructions as well as EBB arguments are covered.
This commit is contained in:
@@ -5,7 +5,7 @@ isa riscv
|
||||
; regex: WS=[ \t]*
|
||||
|
||||
function %foo(i32, i32) {
|
||||
ebb1(v0: i32, v1: i32):
|
||||
ebb1(v0: i32 [%x8], v1: i32):
|
||||
[-,-] v2 = iadd v0, v1
|
||||
[-] trap
|
||||
[R#1234, %x5, %x11] v6, v7 = iadd_cout v2, v0
|
||||
@@ -14,7 +14,7 @@ ebb1(v0: i32, v1: i32):
|
||||
[Iret#5] return v0, v8
|
||||
}
|
||||
; sameln: function %foo(i32, i32) native {
|
||||
; nextln: $ebb1($v0: i32, $v1: i32):
|
||||
; nextln: $ebb1($v0: i32 [%x8], $v1: i32):
|
||||
; nextln: [-,-]$WS $v2 = iadd $v0, $v1
|
||||
; nextln: [-]$WS trap
|
||||
; nextln: [R#1234,%x5,%x11]$WS $v6, $v7 = iadd_cout $v2, $v0
|
||||
|
||||
@@ -4,6 +4,7 @@ isa riscv
|
||||
; Test the coalescer.
|
||||
; regex: V=v\d+
|
||||
; regex: WS=\s+
|
||||
; regex: LOC=%\w+
|
||||
|
||||
; This function is already CSSA, so no copies should be inserted.
|
||||
function %cssa(i32) -> i32 {
|
||||
@@ -81,7 +82,7 @@ ebb0(v0: i32):
|
||||
|
||||
ebb1(v10: i32, v11: i32):
|
||||
; v11 needs to be isolated because it interferes with v10.
|
||||
; check: $ebb1($v10: i32, $(nv11a=$V): i32)
|
||||
; check: $ebb1($v10: i32 [$LOC], $(nv11a=$V): i32 [$LOC])
|
||||
; check: $v11 = copy $nv11a
|
||||
v12 = iadd v10, v11
|
||||
v13 = icmp ult v12, v0
|
||||
|
||||
@@ -25,7 +25,7 @@ function %pyramid(i32) -> i32 {
|
||||
; check: ss2 = spill_slot 4
|
||||
; not: spill_slot
|
||||
ebb0(v1: i32):
|
||||
; check: $ebb0($(rv1=$V): i32, $(rlink=$V): i32)
|
||||
; check: $ebb0($(rv1=$V): i32 [%x10], $(rlink=$V): i32 [%x1])
|
||||
; check: ,ss0]$WS $v1 = spill $rv1
|
||||
; nextln: ,ss1]$WS $(link=$V) = spill $rlink
|
||||
; not: spill
|
||||
@@ -155,7 +155,7 @@ function %use_spilled_value(i32) -> i32 {
|
||||
; check: ss1 = spill_slot 4
|
||||
; check: ss2 = spill_slot 4
|
||||
ebb0(v1: i32):
|
||||
; check: $ebb0($(rv1=$V): i32, $(rlink=$V): i32)
|
||||
; check: $ebb0($(rv1=$V): i32 [%x10], $(rlink=$V): i32 [%x1])
|
||||
; check: ,ss0]$WS $v1 = spill $rv1
|
||||
; nextln: ,ss1]$WS $(link=$V) = spill $rlink
|
||||
; not: spill
|
||||
|
||||
Reference in New Issue
Block a user