19using namespace AMDGPU;
30constexpr GPUInfo R600GPUs[] = {
63constexpr GPUInfo AMDGCNGPUs[] = {
133 return A.Kind <
B.Kind;
136 if (
I == Table.
end())
144 if (
const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
145 return Entry->CanonicalName;
150 if (
const auto *Entry = getArchEntry(AK, R600GPUs))
151 return Entry->CanonicalName;
156 for (
const auto &
C : AMDGCNGPUs) {
161 return AMDGPU::GPUKind::GK_NONE;
165 for (
const auto &
C : R600GPUs) {
170 return AMDGPU::GPUKind::GK_NONE;
174 if (
const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
175 return Entry->Features;
180 if (
const auto *Entry = getArchEntry(AK, R600GPUs))
181 return Entry->Features;
187 for (
const auto &
C : AMDGCNGPUs)
192 for (
const auto &
C : R600GPUs)
198 if (AK == AMDGPU::GPUKind::GK_NONE) {
199 if (GPU ==
"generic-hsa")
201 if (GPU ==
"generic")
249 default:
return {0, 0, 0};
273 Features[
"ci-insts"] =
true;
274 Features[
"dot5-insts"] =
true;
275 Features[
"dot7-insts"] =
true;
276 Features[
"dot8-insts"] =
true;
277 Features[
"dot9-insts"] =
true;
278 Features[
"dot10-insts"] =
true;
279 Features[
"dl-insts"] =
true;
280 Features[
"16-bit-insts"] =
true;
281 Features[
"dpp"] =
true;
282 Features[
"gfx8-insts"] =
true;
283 Features[
"gfx9-insts"] =
true;
284 Features[
"gfx10-insts"] =
true;
285 Features[
"gfx10-3-insts"] =
true;
286 Features[
"gfx11-insts"] =
true;
287 Features[
"atomic-fadd-rtn-insts"] =
true;
288 Features[
"image-insts"] =
true;
289 Features[
"gws"] =
true;
298 Features[
"ci-insts"] =
true;
299 Features[
"dot1-insts"] =
true;
300 Features[
"dot2-insts"] =
true;
301 Features[
"dot5-insts"] =
true;
302 Features[
"dot6-insts"] =
true;
303 Features[
"dot7-insts"] =
true;
304 Features[
"dot10-insts"] =
true;
305 Features[
"dl-insts"] =
true;
306 Features[
"16-bit-insts"] =
true;
307 Features[
"dpp"] =
true;
308 Features[
"gfx8-insts"] =
true;
309 Features[
"gfx9-insts"] =
true;
310 Features[
"gfx10-insts"] =
true;
311 Features[
"gfx10-3-insts"] =
true;
312 Features[
"image-insts"] =
true;
313 Features[
"s-memrealtime"] =
true;
314 Features[
"s-memtime-inst"] =
true;
315 Features[
"gws"] =
true;
319 Features[
"dot1-insts"] =
true;
320 Features[
"dot2-insts"] =
true;
321 Features[
"dot5-insts"] =
true;
322 Features[
"dot6-insts"] =
true;
323 Features[
"dot7-insts"] =
true;
324 Features[
"dot10-insts"] =
true;
328 Features[
"dl-insts"] =
true;
329 Features[
"ci-insts"] =
true;
330 Features[
"16-bit-insts"] =
true;
331 Features[
"dpp"] =
true;
332 Features[
"gfx8-insts"] =
true;
333 Features[
"gfx9-insts"] =
true;
334 Features[
"gfx10-insts"] =
true;
335 Features[
"image-insts"] =
true;
336 Features[
"s-memrealtime"] =
true;
337 Features[
"s-memtime-inst"] =
true;
338 Features[
"gws"] =
true;
343 Features[
"gfx940-insts"] =
true;
344 Features[
"fp8-insts"] =
true;
345 Features[
"atomic-ds-pk-add-16-insts"] =
true;
346 Features[
"atomic-flat-pk-add-16-insts"] =
true;
347 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
348 Features[
"gfx90a-insts"] =
true;
349 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
350 Features[
"atomic-fadd-rtn-insts"] =
true;
351 Features[
"dot3-insts"] =
true;
352 Features[
"dot4-insts"] =
true;
353 Features[
"dot5-insts"] =
true;
354 Features[
"dot6-insts"] =
true;
355 Features[
"mai-insts"] =
true;
356 Features[
"dl-insts"] =
true;
357 Features[
"dot1-insts"] =
true;
358 Features[
"dot2-insts"] =
true;
359 Features[
"dot7-insts"] =
true;
360 Features[
"dot10-insts"] =
true;
361 Features[
"gfx9-insts"] =
true;
362 Features[
"gfx8-insts"] =
true;
363 Features[
"16-bit-insts"] =
true;
364 Features[
"dpp"] =
true;
365 Features[
"s-memrealtime"] =
true;
366 Features[
"ci-insts"] =
true;
367 Features[
"s-memtime-inst"] =
true;
368 Features[
"gws"] =
true;
371 Features[
"gfx90a-insts"] =
true;
372 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
373 Features[
"atomic-fadd-rtn-insts"] =
true;
376 Features[
"dot3-insts"] =
true;
377 Features[
"dot4-insts"] =
true;
378 Features[
"dot5-insts"] =
true;
379 Features[
"dot6-insts"] =
true;
380 Features[
"mai-insts"] =
true;
383 Features[
"dl-insts"] =
true;
384 Features[
"dot1-insts"] =
true;
385 Features[
"dot2-insts"] =
true;
386 Features[
"dot7-insts"] =
true;
387 Features[
"dot10-insts"] =
true;
394 Features[
"gfx9-insts"] =
true;
401 Features[
"gfx8-insts"] =
true;
402 Features[
"16-bit-insts"] =
true;
403 Features[
"dpp"] =
true;
404 Features[
"s-memrealtime"] =
true;
412 Features[
"ci-insts"] =
true;
417 Features[
"image-insts"] =
true;
418 Features[
"s-memtime-inst"] =
true;
419 Features[
"gws"] =
true;
457 bool IsWave32Capable =
false;
478 IsWave32Capable =
true;
484 return IsWave32Capable;
489 std::string &ErrorMsg) {
491 const bool IsNullGPU = GPU.
empty();
493 const bool HaveWave32 =
494 (IsWave32Capable || IsNullGPU) && Features.
count(
"wavefrontsize32");
495 const bool HaveWave64 = Features.
count(
"wavefrontsize64");
496 if (HaveWave32 && HaveWave64) {
497 ErrorMsg =
"'wavefrontsize32' and 'wavefrontsize64' are mutually exclusive";
503 if (!HaveWave32 && !HaveWave64) {
505 IsWave32Capable ?
"wavefrontsize32" :
"wavefrontsize64";
506 Features.
insert(std::make_pair(DefaultWaveSizeFeature,
true));
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isWave32Capable(StringRef GPU, const Triple &T)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
size_type count(StringRef Key) const
count - Return 1 if the element is in the map, 0 otherwise.
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
StringRef - Represent a constant reference to a string, i.e.
constexpr bool empty() const
empty - Check if the string is empty.
Triple - Helper class for working with autoconf configuration names.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
StringRef getArchNameR600(GPUKind AK)
GPUKind
GPU kinds supported by the AMDGPU target.
StringRef getCanonicalArchName(const Triple &T, StringRef Arch)
void fillValidArchListR600(SmallVectorImpl< StringRef > &Values)
IsaVersion getIsaVersion(StringRef GPU)
void fillAMDGPUFeatureMap(StringRef GPU, const Triple &T, StringMap< bool > &Features)
Fills Features map with default values for given target GPU.
void fillValidArchListAMDGCN(SmallVectorImpl< StringRef > &Values)
GPUKind parseArchAMDGCN(StringRef CPU)
bool insertWaveSizeFeature(StringRef GPU, const Triple &T, StringMap< bool > &Features, std::string &ErrorMsg)
Inserts wave size feature for given GPU into features map.
@ FEATURE_FAST_DENORMAL_F32
StringRef getArchNameAMDGCN(GPUKind AK)
unsigned getArchAttrAMDGCN(GPUKind AK)
unsigned getArchAttrR600(GPUKind AK)
GPUKind parseArchR600(StringRef CPU)
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
auto lower_bound(R &&Range, T &&Value)
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Instruction set architecture version.