Legalize entry block arguments to match ABI types.

Insert conversion code that reconstructs the original function argument
types from the legalized ABI signature.

Add abi::legalize_abi_value(). This function is used when adapting code
to a legalized function signature.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-06 13:57:36 -08:00
parent 77492aa463
commit 37b2e94c72
6 changed files with 288 additions and 27 deletions

View File

@@ -2,6 +2,9 @@
test legalizer
isa riscv
; regex: V=v\d+
; regex: VX=vx\d+
function f(i32) {
sig0 = signature(i32) -> i32
@@ -21,3 +24,11 @@ function f(i32) {
ebb0(v0: i32):
return_reg v0
}
function int_split_args(i64) -> i64 {
ebb0(v0: i64):
; check: $ebb0($(v0l=$VX): i32, $(v0h=$VX): i32):
; check: iconcat_lohi $v0l, $v0h
v1 = iadd_imm v0, 1
return v0
}