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 LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H
16 #define LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H
18 #include "AMDGPUMachineFunction.h"
19 #include "SIRegisterInfo.h"
24 class MachineRegisterInfo;
26 /// This class keeps track of the SPI_SP_INPUT_ADDR config register, which
27 /// tells the hardware which interpolation parameters to load.
28 class SIMachineFunctionInfo : public AMDGPUMachineFunction {
29 void anchor() override;
39 SpilledReg(unsigned R, int L) : VGPR (R), Lane (L) { }
40 SpilledReg() : VGPR(0), Lane(-1) { }
41 bool hasLane() { return Lane != -1;}
44 // SIMachineFunctionInfo definition
46 SIMachineFunctionInfo(const MachineFunction &MF);
47 SpilledReg getSpilledReg(MachineFunction *MF, unsigned FrameIndex,
50 unsigned NumUserSGPRs;
51 std::map<unsigned, unsigned> LaneVGPRs;
52 unsigned LDSWaveSpillSize;
53 unsigned ScratchOffsetReg;
54 bool hasCalculatedTID() const { return TIDReg != AMDGPU::NoRegister; };
55 unsigned getTIDReg() const { return TIDReg; };
56 void setTIDReg(unsigned Reg) { TIDReg = Reg; }
57 bool hasSpilledVGPRs() const { return HasSpilledVGPRs; }
58 void setHasSpilledVGPRs(bool Spill = true) { HasSpilledVGPRs = Spill; }
60 unsigned getMaximumWorkGroupSize(const MachineFunction &MF) const;
63 } // End namespace llvm