summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/SparcRegisterInfo.h
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2009-10-07 17:12:56 +0000
committerJim Grosbach <grosbach@apple.com>2009-10-07 17:12:56 +0000
commitfa14dd430c356addea304775822bf7719b76ad3f (patch)
treed0a4a7057b58658f8670fc5885e3f64f70ad0644 /llvm/lib/Target/Sparc/SparcRegisterInfo.h
parent12df37c5d7631128a99cf5283c8e02be291a9b0f (diff)
downloadbcm5719-llvm-fa14dd430c356addea304775822bf7719b76ad3f.tar.gz
bcm5719-llvm-fa14dd430c356addea304775822bf7719b76ad3f.zip
Add register-reuse to frame-index register scavenging. When a target uses
a virtual register to eliminate a frame index, it can return that register and the constant stored there to PEI to track. When scavenging to allocate for those registers, PEI then tracks the last-used register and value, and if it is still available and matches the value for the next index, reuses the existing value rather and removes the re-materialization instructions. Fancier tracking and adjustment of scavenger allocations to keep more values live for longer is possible, but not yet implemented and would likely be better done via a different, less special-purpose, approach to the problem. eliminateFrameIndex() is modified so the target implementations can return the registers they wish to be tracked for reuse. ARM Thumb1 implements and utilizes the new mechanism. All other targets are simply modified to adjust for the changed eliminateFrameIndex() prototype. llvm-svn: 83467
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcRegisterInfo.h')
-rw-r--r--llvm/lib/Target/Sparc/SparcRegisterInfo.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/Sparc/SparcRegisterInfo.h b/llvm/lib/Target/Sparc/SparcRegisterInfo.h
index fc863f3b28f..753b1c04929 100644
--- a/llvm/lib/Target/Sparc/SparcRegisterInfo.h
+++ b/llvm/lib/Target/Sparc/SparcRegisterInfo.h
@@ -43,8 +43,9 @@ struct SparcRegisterInfo : public SparcGenRegisterInfo {
MachineBasicBlock &MBB,
MachineBasicBlock::iterator I) const;
- void eliminateFrameIndex(MachineBasicBlock::iterator II,
- int SPAdj, RegScavenger *RS = NULL) const;
+ unsigned eliminateFrameIndex(MachineBasicBlock::iterator II,
+ int SPAdj, int *Value = NULL,
+ RegScavenger *RS = NULL) const;
void processFunctionBeforeFrameFinalized(MachineFunction &MF) const;
OpenPOWER on IntegriCloud