1 //===- SIMachineFunctionInfo.h - SIMachineFunctionInfo interface -*- C++ -*-==//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 //===----------------------------------------------------------------------===//
15 #ifndef SIMACHINEFUNCTIONINFO_H_
16 #define SIMACHINEFUNCTIONINFO_H_
18 #include "AMDGPUMachineFunction.h"
23 class MachineRegisterInfo;
25 /// This class keeps track of the SPI_SP_INPUT_ADDR config register, which
26 /// tells the hardware which interpolation parameters to load.
27 class SIMachineFunctionInfo : public AMDGPUMachineFunction {
28 virtual void anchor();
34 SpilledReg(unsigned R, int L) : VGPR (R), Lane (L) { }
35 SpilledReg() : VGPR(0), Lane(-1) { }
36 bool hasLane() { return Lane != -1;}
39 struct RegSpillTracker {
42 std::map<unsigned, SpilledReg> SpilledRegisters;
45 RegSpillTracker() : CurrentLane(0), SpilledRegisters(), LaneVGPR(0) { }
46 unsigned getNextLane(MachineRegisterInfo &MRI);
47 void addSpilledReg(unsigned FrameIndex, unsigned Reg, int Lane = -1);
48 const SpilledReg& getSpilledReg(unsigned FrameIndex);
49 bool programSpillsRegisters() { return !SpilledRegisters.empty(); }
52 // SIMachineFunctionInfo definition
54 SIMachineFunctionInfo(const MachineFunction &MF);
56 struct RegSpillTracker SpillTracker;
59 } // End namespace llvm
62 #endif //_SIMACHINEFUNCTIONINFO_H_