aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PowerPCISelSimple.cpp
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-07-27 17:13:58 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-07-27 17:13:58 +0000
commit435c785803b98f5e6f837a4564ddc4e78b22d659 (patch)
tree000052a4609a083687687eb1c320eea303fc73f2 /lib/Target/PowerPC/PowerPCISelSimple.cpp
parent892cdb3b3a93d54c0f48490a5518369932f07028 (diff)
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
Diffstat (limited to 'lib/Target/PowerPC/PowerPCISelSimple.cpp')
-rw-r--r--lib/Target/PowerPC/PowerPCISelSimple.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PowerPCISelSimple.cpp b/lib/Target/PowerPC/PowerPCISelSimple.cpp
index ae7cf3ed40..27852619a1 100644
--- a/lib/Target/PowerPC/PowerPCISelSimple.cpp
+++ b/lib/Target/PowerPC/PowerPCISelSimple.cpp
@@ -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);