De-virtualize or remove some methods that have no overrides nor override anything...
[oota-llvm.git] / lib / Target / R600 / AMDGPUSubtarget.h
1 //=====-- AMDGPUSubtarget.h - Define Subtarget for the AMDIL ---*- 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 /// \brief AMDGPU specific subclass of TargetSubtarget.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef AMDGPUSUBTARGET_H
16 #define AMDGPUSUBTARGET_H
17 #include "AMDGPU.h"
18 #include "llvm/ADT/StringExtras.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Target/TargetSubtargetInfo.h"
21
22 #define GET_SUBTARGETINFO_HEADER
23 #include "AMDGPUGenSubtargetInfo.inc"
24
25 #define MAX_CB_SIZE (1 << 16)
26
27 namespace llvm {
28
29 class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
30 public:
31   enum Generation {
32     R600 = 0,
33     R700,
34     EVERGREEN,
35     NORTHERN_ISLANDS,
36     SOUTHERN_ISLANDS,
37     SEA_ISLANDS
38   };
39
40 private:
41   size_t DefaultSize[3];
42   std::string DevName;
43   bool Is64bit;
44   bool Is32on64bit;
45   bool DumpCode;
46   bool R600ALUInst;
47   bool HasVertexCache;
48   short TexVTXClauseSize;
49   enum Generation Gen;
50   bool FP64;
51   bool CaymanISA;
52   bool EnableIRStructurizer;
53   bool EnableIfCvt;
54   unsigned WavefrontSize;
55   bool CFALUBug;
56
57   InstrItineraryData InstrItins;
58
59 public:
60   AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS);
61
62   const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
63   void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
64
65   bool is64bit() const;
66   bool hasVertexCache() const;
67   short getTexVTXClauseSize() const;
68   enum Generation getGeneration() const;
69   bool hasHWFP64() const;
70   bool hasCaymanISA() const;
71
72   bool hasBFE() const {
73     return (getGeneration() >= EVERGREEN);
74   }
75
76   bool hasBFM() const {
77     return hasBFE();
78   }
79
80   bool hasMulU24() const {
81     return (getGeneration() >= EVERGREEN);
82   }
83
84   bool hasMulI24() const {
85     return (getGeneration() >= SOUTHERN_ISLANDS ||
86             hasCaymanISA());
87   }
88
89   bool IsIRStructurizerEnabled() const;
90   bool isIfCvtEnabled() const;
91   unsigned getWavefrontSize() const;
92   unsigned getStackEntrySize() const;
93   bool hasCFAluBug() const;
94
95   bool enableMachineScheduler() const override {
96     return getGeneration() <= NORTHERN_ISLANDS;
97   }
98
99   // Helper functions to simplify if statements
100   bool isTargetELF() const;
101   std::string getDeviceName() const;
102   virtual size_t getDefaultSize(uint32_t dim) const final;
103   bool dumpCode() const { return DumpCode; }
104   bool r600ALUEncoding() const { return R600ALUInst; }
105
106 };
107
108 } // End namespace llvm
109
110 #endif // AMDGPUSUBTARGET_H