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 "llvm/ADT/StringExtras.h"
19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Target/TargetSubtargetInfo.h"
22 #define GET_SUBTARGETINFO_HEADER
23 #include "AMDGPUGenSubtargetInfo.inc"
25 #define MAX_CB_SIZE (1 << 16)
29 class AMDGPUSubtarget : public AMDGPUGenSubtargetInfo {
41 size_t DefaultSize[3];
48 short TexVTXClauseSize;
52 bool EnableIRStructurizer;
54 unsigned WavefrontSize;
57 InstrItineraryData InstrItins;
60 AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS);
62 const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
63 virtual void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
66 bool hasVertexCache() const;
67 short getTexVTXClauseSize() const;
68 enum Generation getGeneration() const;
69 bool hasHWFP64() const;
70 bool hasCaymanISA() const;
71 bool IsIRStructurizerEnabled() const;
72 bool isIfCvtEnabled() const;
73 unsigned getWavefrontSize() const;
74 unsigned getStackEntrySize() const;
75 bool hasCFAluBug() const;
77 virtual bool enableMachineScheduler() const {
78 return getGeneration() <= NORTHERN_ISLANDS;
81 // Helper functions to simplify if statements
82 bool isTargetELF() const;
83 std::string getDeviceName() const;
84 virtual size_t getDefaultSize(uint32_t dim) const;
85 bool dumpCode() const { return DumpCode; }
86 bool r600ALUEncoding() const { return R600ALUInst; }
90 } // End namespace llvm
92 #endif // AMDGPUSUBTARGET_H