Use returned Value from append_ebb_param in prologue_epilogue.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
ced39f5186
commit
a26d438b30
@@ -169,11 +169,7 @@ impl TargetIsa for Isa {
|
|||||||
|
|
||||||
// Append param to entry EBB
|
// Append param to entry EBB
|
||||||
let entry_ebb = func.layout.entry_block().expect("missing entry block");
|
let entry_ebb = func.layout.entry_block().expect("missing entry block");
|
||||||
func.dfg.append_ebb_param(entry_ebb, csr_type);
|
let fp = func.dfg.append_ebb_param(entry_ebb, csr_type);
|
||||||
|
|
||||||
// Find our frame pointer parameter Value
|
|
||||||
let fp = func.special_param(ir::ArgumentPurpose::FramePointer)
|
|
||||||
.expect("missing frame pointer");
|
|
||||||
|
|
||||||
// Assign it a location
|
// Assign it a location
|
||||||
func.locations[fp] = ir::ValueLoc::Reg(RU::rbp as RegUnit);
|
func.locations[fp] = ir::ValueLoc::Reg(RU::rbp as RegUnit);
|
||||||
@@ -181,17 +177,13 @@ impl TargetIsa for Isa {
|
|||||||
let mut csr_vals = Vec::new();
|
let mut csr_vals = Vec::new();
|
||||||
for reg in &csrs {
|
for reg in &csrs {
|
||||||
// Append param to entry EBB
|
// Append param to entry EBB
|
||||||
func.dfg.append_ebb_param(entry_ebb, csr_type);
|
let csr_arg = func.dfg.append_ebb_param(entry_ebb, csr_type);
|
||||||
|
|
||||||
let csr_arg = func.dfg.ebb_params(entry_ebb).last().expect(
|
|
||||||
"no last argument",
|
|
||||||
);
|
|
||||||
|
|
||||||
// Assign it a location
|
// Assign it a location
|
||||||
func.locations[*csr_arg] = ir::ValueLoc::Reg(*reg as RegUnit);
|
func.locations[csr_arg] = ir::ValueLoc::Reg(*reg as RegUnit);
|
||||||
|
|
||||||
// Remember it so we can push it momentarily
|
// Remember it so we can push it momentarily
|
||||||
csr_vals.push(*csr_arg);
|
csr_vals.push(csr_arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user