mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-17 21:35:07 +00:00
Update ATUsed every time after expandRegLargeImmPair is called.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129104 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e32cdef38e
commit
3f92b439d9
@ -288,7 +288,8 @@ void MipsFrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
// Save the return address only if the function isnt a leaf one.
|
||||
// sw $ra, stack_loc($sp)
|
||||
if (MFI->adjustsStack()) {
|
||||
expandRegLargeImmPair(Mips::SP, RAOffset, NewReg, NewImm, MBB, MBBI);
|
||||
ATUsed = expandRegLargeImmPair(Mips::SP, RAOffset, NewReg, NewImm, MBB,
|
||||
MBBI);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(Mips::SW))
|
||||
.addReg(Mips::RA).addImm(NewImm).addReg(NewReg);
|
||||
|
||||
@ -301,7 +302,8 @@ void MipsFrameLowering::emitPrologue(MachineFunction &MF) const {
|
||||
// to point to the stack pointer
|
||||
if (hasFP(MF)) {
|
||||
// sw $fp,stack_loc($sp)
|
||||
expandRegLargeImmPair(Mips::SP, FPOffset, NewReg, NewImm, MBB, MBBI);
|
||||
ATUsed = expandRegLargeImmPair(Mips::SP, FPOffset, NewReg, NewImm, MBB,
|
||||
MBBI);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(Mips::SW))
|
||||
.addReg(Mips::FP).addImm(NewImm).addReg(NewReg);
|
||||
|
||||
@ -361,7 +363,8 @@ void MipsFrameLowering::emitEpilogue(MachineFunction &MF,
|
||||
// Restore the return address only if the function isnt a leaf one.
|
||||
// lw $ra, stack_loc($sp)
|
||||
if (MFI->adjustsStack()) {
|
||||
expandRegLargeImmPair(Mips::SP, RAOffset, NewReg, NewImm, MBB, MBBI);
|
||||
ATUsed = expandRegLargeImmPair(Mips::SP, RAOffset, NewReg, NewImm, MBB,
|
||||
MBBI);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(Mips::LW), Mips::RA)
|
||||
.addImm(NewImm).addReg(NewReg);
|
||||
|
||||
@ -372,7 +375,8 @@ void MipsFrameLowering::emitEpilogue(MachineFunction &MF,
|
||||
|
||||
// adjust stack : insert addi sp, sp, (imm)
|
||||
if (NumBytes) {
|
||||
expandRegLargeImmPair(Mips::SP, NumBytes, NewReg, NewImm, MBB, MBBI);
|
||||
ATUsed = expandRegLargeImmPair(Mips::SP, NumBytes, NewReg, NewImm, MBB,
|
||||
MBBI);
|
||||
BuildMI(MBB, MBBI, dl, TII.get(Mips::ADDiu), Mips::SP)
|
||||
.addReg(NewReg).addImm(NewImm);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user