Move the initial stack pointer adjustment to after the CSR pushes.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
ebcbd54f61
commit
a75248d2cf
@@ -234,10 +234,6 @@ fn insert_prologue(
|
||||
RU::rbp as RegUnit,
|
||||
);
|
||||
|
||||
if stack_size > 0 {
|
||||
pos.ins().adjust_sp_imm(Imm64::new(-stack_size));
|
||||
}
|
||||
|
||||
for reg in csrs.iter() {
|
||||
// Append param to entry EBB
|
||||
let csr_arg = pos.func.dfg.append_ebb_param(ebb, csr_type);
|
||||
@@ -248,6 +244,10 @@ fn insert_prologue(
|
||||
// Remember it so we can push it momentarily
|
||||
pos.ins().x86_push(csr_arg);
|
||||
}
|
||||
|
||||
if stack_size > 0 {
|
||||
pos.ins().adjust_sp_imm(Imm64::new(-stack_size));
|
||||
}
|
||||
}
|
||||
|
||||
/// Find all `return` instructions and insert epilogues before them.
|
||||
|
||||
Reference in New Issue
Block a user