Spill values live across calls.

Calls clobber many registers, so spill everything that is live across a
call for now.

In the future, we may add support for callee-saved registers.
This commit is contained in:
Jakob Stoklund Olesen
2017-06-14 08:55:01 -07:00
parent 5a23f975fc
commit f2f162f37e
3 changed files with 33 additions and 1 deletions

View File

@@ -62,3 +62,16 @@ ebb0(v1: i32):
return v21
; check: return $v21, $rlink2
}
; All values live across a call must be spilled
function %across_call(i32) {
fn0 = function %foo(i32)
ebb0(v1: i32):
; check: $v1 = spill
call fn0(v1)
; check: call $fn0
call fn0(v1)
; check: fill $v1
; check: call $fn0
return
}