summaryrefslogtreecommitdiff
path: root/lib/Target/R600/SIMachineFunctionInfo.h
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-05-02 15:41:42 +0000
committerTom Stellard <thomas.stellard@amd.com>2014-05-02 15:41:42 +0000
commit9b226260681e9ee96b431b1cb75924e14d59fb0a (patch)
treef7d896b30e1d71996f98e6b5b4048732da500124 /lib/Target/R600/SIMachineFunctionInfo.h
parentecc189660078eb63e8fc463a7d5872f220d15789 (diff)
downloadllvm-9b226260681e9ee96b431b1cb75924e14d59fb0a.tar.gz
R600/SI: Only create one instruction when spilling/restoring register v3
The register spiller assumes that only one new instruction is created when spilling and restoring registers, so we need to emit pseudo instructions for vector register spills and lower them after register allocation. v2: - Fix calculation of lane index - Extend VGPR liveness to end of program. v3: - Use SIMM16 field of S_NOP to specify multiple NOPs. https://bugs.freedesktop.org/show_bug.cgi?id=75005 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207843 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/SIMachineFunctionInfo.h')
-rw-r--r--lib/Target/R600/SIMachineFunctionInfo.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/R600/SIMachineFunctionInfo.h b/lib/Target/R600/SIMachineFunctionInfo.h
index ef38270d51a1..96e619bde8d6 100644
--- a/lib/Target/R600/SIMachineFunctionInfo.h
+++ b/lib/Target/R600/SIMachineFunctionInfo.h
@@ -43,7 +43,12 @@ public:
public:
unsigned LaneVGPR;
RegSpillTracker() : CurrentLane(0), SpilledRegisters(), LaneVGPR(0) { }
- unsigned getNextLane(MachineRegisterInfo &MRI);
+ /// \p NumRegs The number of consecutive registers what need to be spilled.
+ /// This function will ensure that all registers are stored in
+ /// the same VGPR.
+ /// \returns The lane to be used for storing the first register.
+ unsigned reserveLanes(MachineRegisterInfo &MRI, MachineFunction *MF,
+ unsigned NumRegs = 1);
void addSpilledReg(unsigned FrameIndex, unsigned Reg, int Lane = -1);
const SpilledReg& getSpilledReg(unsigned FrameIndex);
bool programSpillsRegisters() { return !SpilledRegisters.empty(); }