Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 1 | //===- SIMachineFunctionInfo.h - SIMachineFunctionInfo interface -*- C++ -*-==// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | /// \file |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 15 | #ifndef LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H |
| 16 | #define LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 17 | |
Vincent Lejeune | ace6f73 | 2013-04-01 21:47:53 +0000 | [diff] [blame] | 18 | #include "AMDGPUMachineFunction.h" |
Tom Stellard | 9646890 | 2014-09-24 01:33:17 +0000 | [diff] [blame] | 19 | #include "SIRegisterInfo.h" |
Tom Stellard | c149dc0 | 2013-11-27 21:23:35 +0000 | [diff] [blame] | 20 | #include <map> |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 21 | |
| 22 | namespace llvm { |
| 23 | |
Tom Stellard | c149dc0 | 2013-11-27 21:23:35 +0000 | [diff] [blame] | 24 | class MachineRegisterInfo; |
| 25 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 26 | /// This class keeps track of the SPI_SP_INPUT_ADDR config register, which |
| 27 | /// tells the hardware which interpolation parameters to load. |
Vincent Lejeune | ace6f73 | 2013-04-01 21:47:53 +0000 | [diff] [blame] | 28 | class SIMachineFunctionInfo : public AMDGPUMachineFunction { |
Craig Topper | 5656db4 | 2014-04-29 07:57:24 +0000 | [diff] [blame] | 29 | void anchor() override; |
Tom Stellard | 9646890 | 2014-09-24 01:33:17 +0000 | [diff] [blame] | 30 | |
| 31 | unsigned TIDReg; |
Tom Stellard | 42fb60e | 2015-01-14 15:42:31 +0000 | [diff] [blame^] | 32 | bool HasSpilledVGPRs; |
Tom Stellard | 9646890 | 2014-09-24 01:33:17 +0000 | [diff] [blame] | 33 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 34 | public: |
Tom Stellard | c149dc0 | 2013-11-27 21:23:35 +0000 | [diff] [blame] | 35 | |
| 36 | struct SpilledReg { |
| 37 | unsigned VGPR; |
| 38 | int Lane; |
| 39 | SpilledReg(unsigned R, int L) : VGPR (R), Lane (L) { } |
| 40 | SpilledReg() : VGPR(0), Lane(-1) { } |
| 41 | bool hasLane() { return Lane != -1;} |
| 42 | }; |
| 43 | |
Tom Stellard | c149dc0 | 2013-11-27 21:23:35 +0000 | [diff] [blame] | 44 | // SIMachineFunctionInfo definition |
| 45 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 46 | SIMachineFunctionInfo(const MachineFunction &MF); |
Tom Stellard | c5cf2f0 | 2014-08-21 20:40:54 +0000 | [diff] [blame] | 47 | SpilledReg getSpilledReg(MachineFunction *MF, unsigned FrameIndex, |
| 48 | unsigned SubIdx); |
Christian Konig | 99ee0f4 | 2013-03-07 09:04:14 +0000 | [diff] [blame] | 49 | unsigned PSInputAddr; |
Tom Stellard | b02094e | 2014-07-21 15:45:01 +0000 | [diff] [blame] | 50 | unsigned NumUserSGPRs; |
Tom Stellard | c5cf2f0 | 2014-08-21 20:40:54 +0000 | [diff] [blame] | 51 | std::map<unsigned, unsigned> LaneVGPRs; |
Tom Stellard | 9646890 | 2014-09-24 01:33:17 +0000 | [diff] [blame] | 52 | unsigned LDSWaveSpillSize; |
| 53 | bool hasCalculatedTID() const { return TIDReg != AMDGPU::NoRegister; }; |
| 54 | unsigned getTIDReg() const { return TIDReg; }; |
| 55 | void setTIDReg(unsigned Reg) { TIDReg = Reg; } |
Tom Stellard | 42fb60e | 2015-01-14 15:42:31 +0000 | [diff] [blame^] | 56 | bool hasSpilledVGPRs() const { return HasSpilledVGPRs; } |
| 57 | void setHasSpilledVGPRs(bool Spill = true) { HasSpilledVGPRs = Spill; } |
Tom Stellard | 9646890 | 2014-09-24 01:33:17 +0000 | [diff] [blame] | 58 | |
| 59 | unsigned getMaximumWorkGroupSize(const MachineFunction &MF) const; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 60 | }; |
| 61 | |
| 62 | } // End namespace llvm |
| 63 | |
| 64 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 65 | #endif |