]> git.proxmox.com Git - rustc.git/blame - src/llvm/lib/Target/R600/SIMachineFunctionInfo.h
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / lib / Target / R600 / SIMachineFunctionInfo.h
CommitLineData
970d7e83
LB
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
1a4d82fc
JJ
15#ifndef LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H
16#define LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H
970d7e83 17
1a4d82fc
JJ
18#include "AMDGPUMachineFunction.h"
19#include "SIRegisterInfo.h"
20#include <map>
970d7e83
LB
21
22namespace llvm {
23
1a4d82fc
JJ
24class MachineRegisterInfo;
25
970d7e83
LB
26/// This class keeps track of the SPI_SP_INPUT_ADDR config register, which
27/// tells the hardware which interpolation parameters to load.
1a4d82fc
JJ
28class SIMachineFunctionInfo : public AMDGPUMachineFunction {
29 void anchor() override;
30
31 unsigned TIDReg;
85aaf69f 32 bool HasSpilledVGPRs;
1a4d82fc 33
970d7e83 34public:
1a4d82fc
JJ
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
44 // SIMachineFunctionInfo definition
970d7e83
LB
45
46 SIMachineFunctionInfo(const MachineFunction &MF);
1a4d82fc
JJ
47 SpilledReg getSpilledReg(MachineFunction *MF, unsigned FrameIndex,
48 unsigned SubIdx);
970d7e83 49 unsigned PSInputAddr;
1a4d82fc
JJ
50 unsigned NumUserSGPRs;
51 std::map<unsigned, unsigned> LaneVGPRs;
52 unsigned LDSWaveSpillSize;
85aaf69f 53 unsigned ScratchOffsetReg;
1a4d82fc
JJ
54 bool hasCalculatedTID() const { return TIDReg != AMDGPU::NoRegister; };
55 unsigned getTIDReg() const { return TIDReg; };
56 void setTIDReg(unsigned Reg) { TIDReg = Reg; }
85aaf69f
SL
57 bool hasSpilledVGPRs() const { return HasSpilledVGPRs; }
58 void setHasSpilledVGPRs(bool Spill = true) { HasSpilledVGPRs = Spill; }
1a4d82fc
JJ
59
60 unsigned getMaximumWorkGroupSize(const MachineFunction &MF) const;
970d7e83
LB
61};
62
63} // End namespace llvm
64
65
1a4d82fc 66#endif