mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 02:36:06 +00:00
Simplify this use of BuildMI. This is also in preparation for
pool-allocating MachineInstrs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53198 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fd3ff032b8
commit
2d97918ce9
@ -409,7 +409,6 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
|||||||
if (PerformTailCallOpt && I->getOpcode() == PPC::ADJCALLSTACKUP) {
|
if (PerformTailCallOpt && I->getOpcode() == PPC::ADJCALLSTACKUP) {
|
||||||
// Add (actually substract) back the amount the callee popped on return.
|
// Add (actually substract) back the amount the callee popped on return.
|
||||||
if (int CalleeAmt = I->getOperand(1).getImm()) {
|
if (int CalleeAmt = I->getOperand(1).getImm()) {
|
||||||
MachineInstr * New = NULL;
|
|
||||||
bool is64Bit = Subtarget.isPPC64();
|
bool is64Bit = Subtarget.isPPC64();
|
||||||
CalleeAmt *= -1;
|
CalleeAmt *= -1;
|
||||||
unsigned StackReg = is64Bit ? PPC::X1 : PPC::R1;
|
unsigned StackReg = is64Bit ? PPC::X1 : PPC::R1;
|
||||||
@ -420,9 +419,8 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
|||||||
unsigned ORIInstr = is64Bit ? PPC::ORI8 : PPC::ORI;
|
unsigned ORIInstr = is64Bit ? PPC::ORI8 : PPC::ORI;
|
||||||
|
|
||||||
if (isInt16(CalleeAmt)) {
|
if (isInt16(CalleeAmt)) {
|
||||||
New = BuildMI(TII.get(ADDIInstr), StackReg).addReg(StackReg).
|
BuildMI(MBB, I, TII.get(ADDIInstr), StackReg).addReg(StackReg).
|
||||||
addImm(CalleeAmt);
|
addImm(CalleeAmt);
|
||||||
MBB.insert(I, New);
|
|
||||||
} else {
|
} else {
|
||||||
MachineBasicBlock::iterator MBBI = I;
|
MachineBasicBlock::iterator MBBI = I;
|
||||||
BuildMI(MBB, MBBI, TII.get(LISInstr), TmpReg)
|
BuildMI(MBB, MBBI, TII.get(LISInstr), TmpReg)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user