Append link and sret arguments in legalize_signature.

These special-purpose arguments and return values are only relevant for
the function being compiled, so add a `current` flag to
legalize_signature().

- Add the necessary argument values to the entry block to represent
  the special-purpose arguments.
- Propagate the link and sret arguments to return instructions if the
  legalized signature asks for it.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-19 15:44:17 -07:00
parent c040a495c0
commit 315c858b48
9 changed files with 161 additions and 35 deletions

View File

@@ -3,7 +3,7 @@ test legalizer
isa riscv
function parse_encoding(i32 [%x5]) -> i32 [%x10] {
; check: function parse_encoding(i32 [%x5]) -> i32 [%x10] {
; check: function parse_encoding(i32 [%x5], i32 link [%x1]) -> i32 [%x10], i32 link [%x1] {
sig0 = signature(i32 [%x10]) -> i32 [%x10]
; check: sig0 = signature(i32 [%x10]) -> i32 [%x10]