summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCRegisterInfo.h
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-04-09 17:27:09 +0000
committerHal Finkel <hfinkel@anl.gov>2013-04-09 17:27:09 +0000
commitf6f8198d85f278ff03aaf32c9db6ae0b3826395c (patch)
treeb5b4e76c738f25c5402e812080d5af875f3edc55 /lib/Target/PowerPC/PPCRegisterInfo.h
parent307b8535ee4cb37ade40fdc7dd36baa7f27fa34c (diff)
downloadllvm-f6f8198d85f278ff03aaf32c9db6ae0b3826395c.tar.gz
llvm-f6f8198d85f278ff03aaf32c9db6ae0b3826395c.tar.bz2
llvm-f6f8198d85f278ff03aaf32c9db6ae0b3826395c.tar.xz
Use virtual base registers on PPC
On PowerPC, non-vector loads and stores have r+i forms; however, in functions with large stack frames these were not being used to access slots far from the stack pointer because such slots were out of range for the signed 16-bit immediate offset field. This increases register pressure because we need a separate register for each offset (when the r+r form is used). By enabling virtual base registers, we can deal with large stack frames without unduly increasing register pressure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCRegisterInfo.h')
-rw-r--r--lib/Target/PowerPC/PPCRegisterInfo.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.h b/lib/Target/PowerPC/PPCRegisterInfo.h
index 7e6683eeb2..7a48b4b979 100644
--- a/lib/Target/PowerPC/PPCRegisterInfo.h
+++ b/lib/Target/PowerPC/PPCRegisterInfo.h
@@ -61,6 +61,10 @@ public:
return true;
}
+ virtual bool requiresVirtualBaseRegisters(const MachineFunction &MF) const {
+ return true;
+ }
+
void lowerDynamicAlloc(MachineBasicBlock::iterator II) const;
void lowerCRSpilling(MachineBasicBlock::iterator II,
unsigned FrameIndex) const;
@@ -77,6 +81,15 @@ public:
int SPAdj, unsigned FIOperandNum,
RegScavenger *RS = NULL) const;
+ // Support for virtual base registers.
+ bool needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const;
+ void materializeFrameBaseRegister(MachineBasicBlock *MBB,
+ unsigned BaseReg, int FrameIdx,
+ int64_t Offset) const;
+ void resolveFrameIndex(MachineBasicBlock::iterator I,
+ unsigned BaseReg, int64_t Offset) const;
+ bool isFrameOffsetLegal(const MachineInstr *MI, int64_t Offset) const;
+
// Debug information queries.
unsigned getFrameRegister(const MachineFunction &MF) const;