1 //=====-- AMDGPUSubtarget.h - Define Subtarget for the AMDIL ---*- 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 //==-----------------------------------------------------------------------===//
11 /// \brief AMDGPU specific subclass of TargetSubtarget.
13 //===----------------------------------------------------------------------===//
15 #ifndef AMDGPUSUBTARGET_H
16 #define AMDGPUSUBTARGET_H
18 #include "AMDGPUInstrInfo.h"
19 #include "llvm/ADT/StringExtras.h"
20 #include "llvm/ADT/StringRef.h"
21 #include "llvm/Target/TargetSubtargetInfo.h"
23 #define GET_SUBTARGETINFO_HEADER
24 #include "AMDGPUGenSubtargetInfo.inc"
26 #define MAX_CB_SIZE (1 << 16)
30 class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
32 std::unique_ptr<AMDGPUInstrInfo> InstrInfo;
51 short TexVTXClauseSize;
55 bool EnableIRStructurizer;
57 unsigned WavefrontSize;
61 InstrItineraryData InstrItins;
64 AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS);
66 const AMDGPUInstrInfo *getInstrInfo() const {
67 return InstrInfo.get();
69 const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
70 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
73 bool hasVertexCache() const;
74 short getTexVTXClauseSize() const;
75 enum Generation getGeneration() const;
76 bool hasHWFP64() const;
77 bool hasCaymanISA() const;
80 return (getGeneration() >= EVERGREEN);
84 return (getGeneration() >= EVERGREEN);
91 bool hasBCNT(unsigned Size) const {
93 return (getGeneration() >= EVERGREEN);
96 return (getGeneration() >= SOUTHERN_ISLANDS);
99 bool hasMulU24() const {
100 return (getGeneration() >= EVERGREEN);
103 bool hasMulI24() const {
104 return (getGeneration() >= SOUTHERN_ISLANDS ||
108 bool IsIRStructurizerEnabled() const;
109 bool isIfCvtEnabled() const;
110 unsigned getWavefrontSize() const;
111 unsigned getStackEntrySize() const;
112 bool hasCFAluBug() const;
113 int getLocalMemorySize() const;
115 bool enableMachineScheduler() const override {
116 return getGeneration() <= NORTHERN_ISLANDS;
119 // Helper functions to simplify if statements
120 bool isTargetELF() const;
121 std::string getDeviceName() const;
122 bool dumpCode() const { return DumpCode; }
123 bool r600ALUEncoding() const { return R600ALUInst; }
127 } // End namespace llvm
129 #endif // AMDGPUSUBTARGET_H