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;
50 short TexVTXClauseSize;
54 bool EnableIRStructurizer;
56 unsigned WavefrontSize;
60 InstrItineraryData InstrItins;
63 AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS);
65 const AMDGPUInstrInfo *getInstrInfo() const {
66 return InstrInfo.get();
68 const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
69 void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
72 bool hasVertexCache() const;
73 short getTexVTXClauseSize() const;
74 enum Generation getGeneration() const;
75 bool hasHWFP64() const;
76 bool hasCaymanISA() const;
79 return (getGeneration() >= EVERGREEN);
83 return (getGeneration() >= EVERGREEN);
90 bool hasBCNT(unsigned Size) const {
92 return (getGeneration() >= EVERGREEN);
95 return (getGeneration() >= SOUTHERN_ISLANDS);
98 bool hasMulU24() const {
99 return (getGeneration() >= EVERGREEN);
102 bool hasMulI24() const {
103 return (getGeneration() >= SOUTHERN_ISLANDS ||
107 bool IsIRStructurizerEnabled() const;
108 bool isIfCvtEnabled() const;
109 unsigned getWavefrontSize() const;
110 unsigned getStackEntrySize() const;
111 bool hasCFAluBug() const;
112 int getLocalMemorySize() const;
114 bool enableMachineScheduler() const override {
115 return getGeneration() <= NORTHERN_ISLANDS;
118 // Helper functions to simplify if statements
119 bool isTargetELF() const;
120 std::string getDeviceName() const;
121 bool dumpCode() const { return DumpCode; }
122 bool r600ALUEncoding() const { return R600ALUInst; }
126 } // End namespace llvm
128 #endif // AMDGPUSUBTARGET_H