LLVM: lib/Target/NVPTX/NVPTXSubtarget.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXSUBTARGET_H
14#define LLVM_LIB_TARGET_NVPTX_NVPTXSUBTARGET_H
15
24#include
25
26#define GET_SUBTARGETINFO_HEADER
27#include "NVPTXGenSubtargetInfo.inc"
28
29namespace llvm {
30
32 virtual void anchor();
33 std::string TargetName;
34
35
36 unsigned PTXVersion;
37
38
39
40 unsigned int FullSmVersion;
41
42
43
44 unsigned int SmVersion;
45
48 std::unique_ptr TSInfo;
49
50
51
53
54public:
55
56
57
60
62
64 return &FrameLowering;
65 }
68 return &InstrInfo.getRegisterInfo();
69 }
73
75
76
77
78
79
82
83
84
87
89 return SmVersion >= 100 && PTXVersion >= 88 &&
91 }
96 bool hasAtomCas16() const { return SmVersion >= 70 && PTXVersion >= 63; }
97 bool hasAtomSwap128() const { return SmVersion >= 90 && PTXVersion >= 83; }
98 bool hasClusters() const { return SmVersion >= 90 && PTXVersion >= 78; }
99 bool hasLDG() const { return SmVersion >= 32; }
100 bool hasHWROT32() const { return SmVersion >= 32; }
105 bool hasNoReturn() const { return SmVersion >= 30 && PTXVersion >= 64; }
106
107
108 bool hasMemoryOrdering() const { return SmVersion >= 70 && PTXVersion >= 60; }
109
111 return SmVersion >= 90 && PTXVersion >= 86;
112 }
113
114 bool hasRelaxedMMIO() const { return SmVersion >= 70 && PTXVersion >= 82; }
116 return SmVersion >= 61 && PTXVersion >= 50;
117 }
118
120 bool HasTcgen05 = false;
121 unsigned MinPTXVersion = 86;
122 switch (FullSmVersion) {
123 default:
124 break;
125 case 1003:
126 case 1013:
127 HasTcgen05 = true;
128 break;
129 case 1103:
130 HasTcgen05 = true;
131 MinPTXVersion = 90;
132 break;
133 case 1033:
134 HasTcgen05 = true;
135 MinPTXVersion = 88;
136 break;
137 }
138
139 return HasTcgen05 && PTXVersion >= MinPTXVersion;
140 }
141
142
143
144
145
146
147
154
155
162
164 return FullSmVersion == 1003 && PTXVersion >= 86;
165 }
166
168
169
170
171
172
173
179
180
182 if (PTXVersion >= 81)
183 return SmVersion >= 89;
184
185 if (PTXVersion >= 78)
186 return SmVersion >= 90;
187
188 return false;
189 }
190
191
192
193
194
200
201
202
203
204
205
206
207
209 bool hasCvtaParam() const { return SmVersion >= 70 && PTXVersion >= 77; }
213
214
215
216
217
218
222
223
224
225
226
231
233 return TargetName.empty() ? "sm_30" : TargetName;
234 }
236
238
239
240
241
242
243
244
245
247
249
251
254
256};
257
258}
259
260#endif
NVPTX address space definition.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition NVPTXSubtarget.h:31
const NVPTXInstrInfo * getInstrInfo() const override
Definition NVPTXSubtarget.h:66
void failIfClustersUnsupported(std::string const &FailureMessage) const
bool hasTMABlackwellSupport() const
Definition NVPTXSubtarget.h:174
bool hasPTXWithAccelSMs(unsigned PTXVersion, ArrayRef< unsigned > SMVersions) const
std::string getTargetName() const
Definition NVPTXSubtarget.h:232
unsigned getMaxRequiredAlignment() const
Definition NVPTXSubtarget.h:246
bool hasAtomMinMax64() const
Definition NVPTXSubtarget.h:95
bool hasTcgen05InstSupport() const
Definition NVPTXSubtarget.h:148
bool hasAtomAddF64() const
Definition NVPTXSubtarget.h:92
bool hasHWROT32() const
Definition NVPTXSubtarget.h:100
bool hasSplitAcquireAndReleaseFences() const
Definition NVPTXSubtarget.h:110
bool hasClusters() const
Definition NVPTXSubtarget.h:98
bool hasMaskOperator() const
Definition NVPTXSubtarget.h:104
bool hasFP8ConversionSupport() const
Definition NVPTXSubtarget.h:181
const NVPTXTargetLowering * getTargetLowering() const override
Definition NVPTXSubtarget.h:70
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
unsigned getMinCmpXchgSizeInBits() const
Definition NVPTXSubtarget.h:248
unsigned getPTXVersion() const
Definition NVPTXSubtarget.h:250
bool hasCvtaParam() const
Definition NVPTXSubtarget.h:209
~NVPTXSubtarget() override
bool hasNativeBF16Support(int Opcode) const
const NVPTXRegisterInfo * getRegisterInfo() const override
Definition NVPTXSubtarget.h:67
unsigned int getFullSmVersion() const
Definition NVPTXSubtarget.h:210
unsigned int getSmVersion() const
Definition NVPTXSubtarget.h:211
bool hasDotInstructions() const
Definition NVPTXSubtarget.h:115
bool hasTcgen05MMAScaleInputDImm() const
Definition NVPTXSubtarget.h:163
bool hasFamilySpecificFeatures() const
Definition NVPTXSubtarget.h:227
bool hasTcgen05Instructions() const
Definition NVPTXSubtarget.h:119
bool hasAtomBitwise64() const
Definition NVPTXSubtarget.h:94
bool hasPTXWithFamilySMs(unsigned PTXVersion, ArrayRef< unsigned > SMVersions) const
bool hasTcgen05ShiftSupport() const
Definition NVPTXSubtarget.h:156
bool hasRelaxedMMIO() const
Definition NVPTXSubtarget.h:114
bool hasTargetName() const
Definition NVPTXSubtarget.h:235
bool hasBF16Math() const
Definition NVPTXSubtarget.h:102
bool hasAtomSwap128() const
Definition NVPTXSubtarget.h:97
bool hasLDG() const
Definition NVPTXSubtarget.h:99
bool hasF32x2Instructions() const
unsigned int getSmFamilyVersion() const
Definition NVPTXSubtarget.h:212
bool allowFP16Math() const
const TargetFrameLowering * getFrameLowering() const override
Definition NVPTXSubtarget.h:63
bool hasAtomScope() const
Definition NVPTXSubtarget.h:93
bool hasAtomCas16() const
Definition NVPTXSubtarget.h:96
NVPTXSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const NVPTXTargetMachine &TM)
This constructor initializes the data members to match that of the specified module.
bool hasNarrowFPConversionSupport() const
Definition NVPTXSubtarget.h:195
bool hasMemoryOrdering() const
Definition NVPTXSubtarget.h:108
bool hasArchAccelFeatures() const
Definition NVPTXSubtarget.h:219
NVPTXSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool has256BitVectorLoadStore(unsigned AS) const
Definition NVPTXSubtarget.h:88
bool hasPTXASUnreachableBug() const
Definition NVPTXSubtarget.h:208
bool hasFP16Math() const
Definition NVPTXSubtarget.h:101
bool hasNoReturn() const
Definition NVPTXSubtarget.h:105
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
StringRef - Represent a constant reference to a string, i.e.
Information about stack frame layout on the target.
Triple - Helper class for working with autoconf configuration names.
This is an optimization pass for GlobalISel generic memory operations.