Don't create value aliases when legalizing ABI boundaries.

When converting from ABI types to original program types, the final
conversion instruction can place its result into the original value, so
it doesn't need to be changed to an alias.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-13 10:16:58 -07:00
parent c716d86c8d
commit f9d3e65419
2 changed files with 38 additions and 32 deletions

View File

@@ -7,7 +7,7 @@ isa riscv
function int_split_args(i64) -> i64 {
ebb0(v0: i64):
; check: $ebb0($(v0l=$V): i32, $(v0h=$V): i32):
; check: iconcat $v0l, $v0h
; check: $v0 = iconcat $v0l, $v0h
v1 = iadd_imm v0, 1
; check: $(v1l=$V), $(v1h=$V) = isplit $v1
; check: return $v1l, $v1h
@@ -33,10 +33,9 @@ ebb0:
v1 = call fn1()
; check: $ebb0:
; nextln: $(v1l=$V), $(v1h=$V) = call $fn1()
; check: $(v1new=$V) = iconcat $v1l, $v1h
; check: $v1 = iconcat $v1l, $v1h
jump ebb1(v1)
; The v1 alias gets resolved by split::simplify_branch_arguments().
; check: jump $ebb1($v1new)
; check: jump $ebb1($v1)
ebb1(v10: i64):
jump ebb1(v10)
@@ -49,10 +48,9 @@ ebb0:
v1, v2 = call fn1()
; check: $ebb0:
; nextln: $v1, $(v2l=$V), $(v2h=$V) = call $fn1()
; check: $(v2new=$V) = iconcat $v2l, $v2h
; check: $v2 = iconcat $v2l, $v2h
jump ebb1(v1, v2)
; The v2 -> v2new alias is resolved by split::simplify_branch_arguments().
; check: jump $ebb1($v1, $v2new)
; check: jump $ebb1($v1, $v2)
ebb1(v9: i32, v10: i64):
jump ebb1(v9, v10)
@@ -61,8 +59,8 @@ ebb1(v9: i32, v10: i64):
function int_ext(i8, i8 sext, i8 uext) -> i8 uext {
ebb0(v1: i8, v2: i8, v3: i8):
; check: $ebb0($v1: i8, $(v2x=$V): i32, $(v3x=$V): i32):
; check: ireduce.i8 $v2x
; check: ireduce.i8 $v3x
; check: $v2 = ireduce.i8 $v2x
; check: $v3 = ireduce.i8 $v3x
; check: $(v1x=$V) = uextend.i32 $v1
; check: return $v1x
return v1
@@ -75,10 +73,9 @@ ebb0:
v1 = call fn1()
; check: $ebb0:
; nextln: $(rv=$V) = call $fn1()
; check: $(v1new=$V) = ireduce.i8 $rv
; check: $v1 = ireduce.i8 $rv
jump ebb1(v1)
; The v1 alias gets resolved by split::simplify_branch_arguments().
; check: jump $ebb1($v1new)
; check: jump $ebb1($v1)
ebb1(v10: i8):
jump ebb1(v10)
@@ -93,9 +90,9 @@ ebb0(v0: i64x4):
; check: $(v0c=$V) = iconcat $v0cl, $v0ch
; check: $(v0d=$V) = iconcat $v0dl, $v0dh
; check: $(v0cd=$V) = vconcat $v0c, $v0d
; check: $(v0abcd=$V) = vconcat $v0ab, $v0cd
; check: $v0 = vconcat $v0ab, $v0cd
v1 = bxor v0, v0
; check: $(v1ab=$V), $(v1cd=$V) = vsplit
; check: $(v1ab=$V), $(v1cd=$V) = vsplit $v1
; check: $(v1a=$V), $(v1b=$V) = vsplit $v1ab
; check: $(v1al=$V), $(v1ah=$V) = isplit $v1a
; check: $(v1bl=$V), $(v1bh=$V) = isplit $v1b