diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2004-06-30 00:09:12 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2004-06-30 00:09:12 +0000 |
commit | ce76db9083900d0998fc0a847d215d92b24dba67 (patch) | |
tree | 25a7407afa2cdffdaee339caef1edb227261189d | |
parent | 14d8c7a6a051e2aaa5f419b0959a0d64c297e7e7 (diff) |
Always assume a function may have calls because the printer may add `bl' to get
the PC in a code sequence for global variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14506 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/PowerPC/PowerPCRegisterInfo.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp index f96aee32d2..5178970c11 100644 --- a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp +++ b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp @@ -187,7 +187,10 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const { // Get the number of bytes to allocate from the FrameInfo unsigned NumBytes = MFI->getStackSize(); - if (MFI->hasCalls()) { + // FIXME: the assembly printer inserts "calls" aka branch-and-link to get the + // PC address. We may not know about those calls at this time, so be + // conservative. + if (MFI->hasCalls() || true) { // When we have no frame pointer, we reserve argument space for call sites // in the function immediately on entry to the current function. This // eliminates the need for add/sub brackets around call sites. @@ -235,7 +238,10 @@ void PowerPCRegisterInfo::emitEpilogue(MachineFunction &MF, MBB.insert(MBBI, MI); // If we have calls, restore the LR value before we branch to it - if (MFI->hasCalls()) { + // FIXME: the assembly printer inserts "calls" aka branch-and-link to get the + // PC address. We may not know about those calls at this time, so be + // conservative. + if (MFI->hasCalls() || true) { // Read old LR from stack into R0 MI = BuildMI(PPC32::LWZ, 2, PPC32::R0).addSImm(8).addReg(PPC32::R1); MBB.insert(MBBI, MI); |