Reload for spilled call return values.

When the return value from a call has been spilled, the reload pass
needs to insert a spill instruction right after the call instruction
which returns its results in registers.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-29 11:09:21 -07:00
parent 711e5cd644
commit 45888ab84e
3 changed files with 48 additions and 0 deletions

View File

@@ -213,6 +213,12 @@ fn get_or_create<'a>(
.operand_constraints(func.encodings[inst])
.and_then(|rc| rc.outs.get(rnum))
.map(Affinity::new)
.or_else(|| {
// If this is a call, get the return value affinity.
func.dfg.call_signature(inst).map(|sig| {
Affinity::abi(&func.dfg.signatures[sig].return_types[rnum], isa)
})
})
.unwrap_or_default();
}
ValueDef::Arg(ebb, num) => {