summaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCRegisterInfo.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-09 21:46:49 +0000
committerChris Lattner <sabre@nondot.org>2005-09-09 21:46:49 +0000
commitf38df04c3a0c2aa766fa50b254d2d0fc743f8152 (patch)
tree96ec08c0df059cb57a6940ac19801af3a53b9959 /lib/Target/PowerPC/PPCRegisterInfo.h
parent1463019e84cea6857914cea30c0180ec7289f09f (diff)
downloadllvm-f38df04c3a0c2aa766fa50b254d2d0fc743f8152.tar.gz
llvm-f38df04c3a0c2aa766fa50b254d2d0fc743f8152.tar.bz2
llvm-f38df04c3a0c2aa766fa50b254d2d0fc743f8152.tar.xz
Fix a problem that Nate noticed, where spill code was not getting coallesced
with copies, leading to code like this: lwz r4, 380(r1) or r10, r4, r4 ;; Last use of r4 By teaching the PPC backend how to fold spills into copies, we now get this code: lwz r10, 380(r1) wow. :) This reduces a testcase nate sent me from 1505 instructions to 1484. Note that this could handle FP values but doesn't currently, for reasons mentioned in the patch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCRegisterInfo.h')
-rw-r--r--lib/Target/PowerPC/PPCRegisterInfo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/PPCRegisterInfo.h b/lib/Target/PowerPC/PPCRegisterInfo.h
index 442eae2693..d274545504 100644
--- a/lib/Target/PowerPC/PPCRegisterInfo.h
+++ b/lib/Target/PowerPC/PPCRegisterInfo.h
@@ -40,6 +40,11 @@ public:
unsigned DestReg, unsigned SrcReg,
const TargetRegisterClass *RC) const;
+ /// foldMemoryOperand - PowerPC (like most RISC's) can only fold spills into
+ /// copy instructions, turning them into load/store instructions.
+ virtual MachineInstr* foldMemoryOperand(MachineInstr* MI, unsigned OpNum,
+ int FrameIndex) const;
+
void eliminateCallFramePseudoInstr(MachineFunction &MF,
MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const;