mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -117,6 +117,9 @@ public:
|
||||
return scavengeRegister(RegClass, MBBI, SPAdj);
|
||||
}
|
||||
|
||||
/// setUsed - Tell the scavenger a register is used.
|
||||
///
|
||||
void setUsed(unsigned Reg);
|
||||
private:
|
||||
/// isReserved - Returns true if a register is reserved. It is never "unused".
|
||||
bool isReserved(unsigned Reg) const { return ReservedRegs.test(Reg); }
|
||||
@@ -131,7 +134,6 @@ private:
|
||||
|
||||
/// setUsed / setUnused - Mark the state of one or a number of registers.
|
||||
///
|
||||
void setUsed(unsigned Reg);
|
||||
void setUsed(BitVector &Regs) {
|
||||
RegsAvailable &= ~Regs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user