mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-29 10:32:47 +00:00
Add IMPLICIT_DEF of LR for branch-and-link instrs (calls and global accesses)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
892cdb3b3a
commit
435c785803
@ -522,6 +522,7 @@ void ISel::copyGlobalBaseToRegister(MachineBasicBlock *MBB,
|
||||
MachineBasicBlock &FirstMBB = F->front();
|
||||
MachineBasicBlock::iterator MBBI = FirstMBB.begin();
|
||||
GlobalBaseReg = makeAnotherReg(Type::IntTy);
|
||||
BuildMI(FirstMBB, MBBI, PPC32::IMPLICIT_DEF, 0, PPC32::LR);
|
||||
BuildMI(FirstMBB, MBBI, PPC32::MovePCtoLR, 0, GlobalBaseReg);
|
||||
GlobalBaseInitialized = true;
|
||||
}
|
||||
@ -1576,6 +1577,7 @@ void ISel::doCall(const ValueRecord &Ret, MachineInstr *CallMI,
|
||||
BuildMI(BB, PPC32::ADJCALLSTACKDOWN, 1).addSImm(0);
|
||||
}
|
||||
|
||||
BuildMI(BB, PPC32::IMPLICIT_DEF, 0, PPC32::LR);
|
||||
BB->push_back(CallMI);
|
||||
BuildMI(BB, PPC32::ADJCALLSTACKUP, 1).addSImm(NumBytes);
|
||||
|
||||
|
@ -522,6 +522,7 @@ void ISel::copyGlobalBaseToRegister(MachineBasicBlock *MBB,
|
||||
MachineBasicBlock &FirstMBB = F->front();
|
||||
MachineBasicBlock::iterator MBBI = FirstMBB.begin();
|
||||
GlobalBaseReg = makeAnotherReg(Type::IntTy);
|
||||
BuildMI(FirstMBB, MBBI, PPC32::IMPLICIT_DEF, 0, PPC32::LR);
|
||||
BuildMI(FirstMBB, MBBI, PPC32::MovePCtoLR, 0, GlobalBaseReg);
|
||||
GlobalBaseInitialized = true;
|
||||
}
|
||||
@ -1576,6 +1577,7 @@ void ISel::doCall(const ValueRecord &Ret, MachineInstr *CallMI,
|
||||
BuildMI(BB, PPC32::ADJCALLSTACKDOWN, 1).addSImm(0);
|
||||
}
|
||||
|
||||
BuildMI(BB, PPC32::IMPLICIT_DEF, 0, PPC32::LR);
|
||||
BB->push_back(CallMI);
|
||||
BuildMI(BB, PPC32::ADJCALLSTACKUP, 1).addSImm(NumBytes);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user