Changes in directory llvm/lib/Target/PowerPC:
PPCRegisterInfo.cpp updated: 1.106 -> 1.107 PPCRegisterInfo.h updated: 1.25 -> 1.26 --- Log message: For PR1207: http://llvm.org/PR1207 : Revert patches that caused the problem. Evan, please investigate and reapply when you've discovered the problem. --- Diffs of the changes: (+9 -32) PPCRegisterInfo.cpp | 39 +++++++++------------------------------ PPCRegisterInfo.h | 2 -- 2 files changed, 9 insertions(+), 32 deletions(-) Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.106 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.107 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.106 Sat Feb 17 05:06:00 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp Sun Feb 18 21:20:00 2007 @@ -34,7 +34,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/MathExtras.h" -#include "llvm/ADT/BitVector.h" #include "llvm/ADT/STLExtras.h" #include <cstdlib> using namespace llvm; @@ -339,35 +338,6 @@ Darwin32_CalleeSavedRegClasses; } -// needsFP - Return true if the specified function should have a dedicated frame -// pointer register. This is true if the function has variable sized allocas or -// if frame pointer elimination is disabled. -// -static bool needsFP(const MachineFunction &MF) { - const MachineFrameInfo *MFI = MF.getFrameInfo(); - return NoFramePointerElim || MFI->hasVarSizedObjects(); -} - -BitVector PPCRegisterInfo::getReservedRegs(const MachineFunction &MF) const { - BitVector Reserved(getNumRegs()); - Reserved.set(PPC::R0); - Reserved.set(PPC::R1); - Reserved.set(PPC::LR); - // In Linux, r2 is reserved for the OS. - if (!Subtarget.isDarwin()) - Reserved.set(PPC::R2); - // On PPC64, r13 is the thread pointer. Never allocate this register. - // Note that this is overconservative, as it also prevents allocation of - // R31 when the FP is not needed. - if (Subtarget.isPPC64()) { - Reserved.set(PPC::R13); - Reserved.set(PPC::R31); - } - if (needsFP(MF)) - Reserved.set(PPC::R31); - return Reserved; -} - /// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into /// copy instructions, turning them into load/store instructions. MachineInstr *PPCRegisterInfo::foldMemoryOperand(MachineInstr *MI, @@ -428,6 +398,15 @@ // Stack Frame Processing methods //===----------------------------------------------------------------------===// +// needsFP - Return true if the specified function should have a dedicated frame +// pointer register. This is true if the function has variable sized allocas or +// if frame pointer elimination is disabled. +// +static bool needsFP(const MachineFunction &MF) { + const MachineFrameInfo *MFI = MF.getFrameInfo(); + return NoFramePointerElim || MFI->hasVarSizedObjects(); +} + // hasFP - Return true if the specified function actually has a dedicated frame // pointer register. This is true if the function needs a frame pointer and has // a non-zero stack size. Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.25 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.26 --- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.25 Sat Feb 17 05:06:00 2007 +++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h Sun Feb 18 21:20:00 2007 @@ -58,8 +58,6 @@ const TargetRegisterClass* const* getCalleeSavedRegClasses() const; - BitVector getReservedRegs(const MachineFunction &MF) const; - /// targetHandlesStackFrameRounding - Returns true if the target is /// responsible for rounding up the stack frame (probably at emitPrologue /// time). _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits