[X86][SSE] Vector integer/float conversion memory folding
[oota-llvm.git] / lib / Target / R600 / SIMachineFunctionInfo.h
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
15 #ifndef LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H
16 #define LLVM_LIB_TARGET_R600_SIMACHINEFUNCTIONINFO_H
17
18 #include "AMDGPUMachineFunction.h"
19 #include "SIRegisterInfo.h"
20 #include <map>
21
22 namespace llvm {
23
24 class MachineRegisterInfo;
25
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;
30
31   unsigned TIDReg;
32
33 public:
34
35   struct SpilledReg {
36     unsigned VGPR;
37     int Lane;
38     SpilledReg(unsigned R, int L) : VGPR (R), Lane (L) { }
39     SpilledReg() : VGPR(0), Lane(-1) { }
40     bool hasLane() { return Lane != -1;}
41   };
42
43   // SIMachineFunctionInfo definition
44
45   SIMachineFunctionInfo(const MachineFunction &MF);
46   SpilledReg getSpilledReg(MachineFunction *MF, unsigned FrameIndex,
47                            unsigned SubIdx);
48   unsigned PSInputAddr;
49   unsigned NumUserSGPRs;
50   std::map<unsigned, unsigned> LaneVGPRs;
51   unsigned LDSWaveSpillSize;
52   bool hasCalculatedTID() const { return TIDReg != AMDGPU::NoRegister; };
53   unsigned getTIDReg() const { return TIDReg; };
54   void setTIDReg(unsigned Reg) { TIDReg = Reg; }
55
56   unsigned getMaximumWorkGroupSize(const MachineFunction &MF) const;
57 };
58
59 } // End namespace llvm
60
61
62 #endif