Generate SSA code from returns (#5172)
Modify return pseudo-instructions to have pairs of registers: virtual and real. This allows us to constrain the virtual registers to the real ones specified by the abi, instead of directly emitting moves to those real registers.
This commit is contained in:
@@ -526,7 +526,7 @@ impl Inst {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn ret(rets: Vec<Reg>) -> Inst {
|
||||
pub(crate) fn ret(rets: Vec<RetPair>) -> Inst {
|
||||
Inst::Ret { rets }
|
||||
}
|
||||
|
||||
@@ -2081,8 +2081,8 @@ fn x64_get_operands<F: Fn(VReg) -> VReg>(inst: &Inst, collector: &mut OperandCol
|
||||
Inst::Ret { rets } => {
|
||||
// The return value(s) are live-out; we represent this
|
||||
// with register uses on the return instruction.
|
||||
for &ret in rets {
|
||||
collector.reg_use(ret);
|
||||
for ret in rets.iter() {
|
||||
collector.reg_fixed_use(ret.vreg, ret.preg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user