LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AMDGPUSubtarget.h
Go to the documentation of this file.
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"
21 
22 #define GET_SUBTARGETINFO_HEADER
23 #include "AMDGPUGenSubtargetInfo.inc"
24 
25 #define MAX_CB_SIZE (1 << 16)
26 
27 namespace llvm {
28 
30 public:
31  enum Generation {
32  R600 = 0,
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 
55  InstrItineraryData InstrItins;
56 
57 public:
59 
60  const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
61  virtual void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
62 
63  bool is64bit() const;
64  bool hasVertexCache() const;
65  short getTexVTXClauseSize() const;
66  enum Generation getGeneration() const;
67  bool hasHWFP64() const;
68  bool hasCaymanISA() const;
69  bool IsIRStructurizerEnabled() const;
70  bool isIfCvtEnabled() const;
71 
72  virtual bool enableMachineScheduler() const {
73  return getGeneration() <= NORTHERN_ISLANDS;
74  }
75 
76  // Helper functions to simplify if statements
77  bool isTargetELF() const;
78  std::string getDataLayout() const;
79  std::string getDeviceName() const;
80  virtual size_t getDefaultSize(uint32_t dim) const;
81  bool dumpCode() const { return DumpCode; }
82  bool r600ALUEncoding() const { return R600ALUInst; }
83 
84 };
85 
86 } // End namespace llvm
87 
88 #endif // AMDGPUSUBTARGET_H
enum Generation getGeneration() const
bool isIfCvtEnabled() const
bool r600ALUEncoding() const
AMDGPUSubtarget(StringRef TT, StringRef CPU, StringRef FS)
std::string getDeviceName() const
bool hasVertexCache() const
bool hasCaymanISA() const
bool dumpCode() const
virtual void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
virtual size_t getDefaultSize(uint32_t dim) const
bool IsIRStructurizerEnabled() const
std::string getDataLayout() const
virtual bool enableMachineScheduler() const
const InstrItineraryData & getInstrItineraryData() const
short getTexVTXClauseSize() const