19using namespace AMDGPU;
30constexpr GPUInfo R600GPUs[] = {
63constexpr GPUInfo AMDGCNGPUs[] = {
143 return A.Kind <
B.Kind;
146 if (
I == Table.
end() ||
I->Kind != Search.Kind)
172 if (
const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
173 return Entry->CanonicalName;
178 if (
const auto *Entry = getArchEntry(AK, R600GPUs))
179 return Entry->CanonicalName;
184 for (
const auto &
C : AMDGCNGPUs) {
189 return AMDGPU::GPUKind::GK_NONE;
193 for (
const auto &
C : R600GPUs) {
198 return AMDGPU::GPUKind::GK_NONE;
202 if (
const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
203 return Entry->Features;
208 if (
const auto *Entry = getArchEntry(AK, R600GPUs))
209 return Entry->Features;
215 for (
const auto &
C : AMDGCNGPUs)
220 for (
const auto &
C : R600GPUs)
226 if (AK == AMDGPU::GPUKind::GK_NONE) {
227 if (GPU ==
"generic-hsa")
229 if (GPU ==
"generic")
299 default:
return {0, 0, 0};
321 Features[
"ci-insts"] =
true;
322 Features[
"dot7-insts"] =
true;
323 Features[
"dot8-insts"] =
true;
324 Features[
"dot9-insts"] =
true;
325 Features[
"dot10-insts"] =
true;
326 Features[
"dot11-insts"] =
true;
327 Features[
"dl-insts"] =
true;
328 Features[
"atomic-ds-pk-add-16-insts"] =
true;
329 Features[
"atomic-flat-pk-add-16-insts"] =
true;
330 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
331 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
332 Features[
"16-bit-insts"] =
true;
333 Features[
"dpp"] =
true;
334 Features[
"gfx8-insts"] =
true;
335 Features[
"gfx9-insts"] =
true;
336 Features[
"gfx10-insts"] =
true;
337 Features[
"gfx10-3-insts"] =
true;
338 Features[
"gfx11-insts"] =
true;
339 Features[
"gfx12-insts"] =
true;
340 Features[
"atomic-fadd-rtn-insts"] =
true;
341 Features[
"image-insts"] =
true;
342 Features[
"fp8-conversion-insts"] =
true;
351 Features[
"ci-insts"] =
true;
352 Features[
"dot5-insts"] =
true;
353 Features[
"dot7-insts"] =
true;
354 Features[
"dot8-insts"] =
true;
355 Features[
"dot9-insts"] =
true;
356 Features[
"dot10-insts"] =
true;
357 Features[
"dl-insts"] =
true;
358 Features[
"16-bit-insts"] =
true;
359 Features[
"dpp"] =
true;
360 Features[
"gfx8-insts"] =
true;
361 Features[
"gfx9-insts"] =
true;
362 Features[
"gfx10-insts"] =
true;
363 Features[
"gfx10-3-insts"] =
true;
364 Features[
"gfx11-insts"] =
true;
365 Features[
"atomic-fadd-rtn-insts"] =
true;
366 Features[
"image-insts"] =
true;
367 Features[
"gws"] =
true;
377 Features[
"ci-insts"] =
true;
378 Features[
"dot1-insts"] =
true;
379 Features[
"dot2-insts"] =
true;
380 Features[
"dot5-insts"] =
true;
381 Features[
"dot6-insts"] =
true;
382 Features[
"dot7-insts"] =
true;
383 Features[
"dot10-insts"] =
true;
384 Features[
"dl-insts"] =
true;
385 Features[
"16-bit-insts"] =
true;
386 Features[
"dpp"] =
true;
387 Features[
"gfx8-insts"] =
true;
388 Features[
"gfx9-insts"] =
true;
389 Features[
"gfx10-insts"] =
true;
390 Features[
"gfx10-3-insts"] =
true;
391 Features[
"image-insts"] =
true;
392 Features[
"s-memrealtime"] =
true;
393 Features[
"s-memtime-inst"] =
true;
394 Features[
"gws"] =
true;
398 Features[
"dot1-insts"] =
true;
399 Features[
"dot2-insts"] =
true;
400 Features[
"dot5-insts"] =
true;
401 Features[
"dot6-insts"] =
true;
402 Features[
"dot7-insts"] =
true;
403 Features[
"dot10-insts"] =
true;
408 Features[
"dl-insts"] =
true;
409 Features[
"ci-insts"] =
true;
410 Features[
"16-bit-insts"] =
true;
411 Features[
"dpp"] =
true;
412 Features[
"gfx8-insts"] =
true;
413 Features[
"gfx9-insts"] =
true;
414 Features[
"gfx10-insts"] =
true;
415 Features[
"image-insts"] =
true;
416 Features[
"s-memrealtime"] =
true;
417 Features[
"s-memtime-inst"] =
true;
418 Features[
"gws"] =
true;
423 Features[
"gfx940-insts"] =
true;
424 Features[
"fp8-insts"] =
true;
425 Features[
"fp8-conversion-insts"] =
true;
426 Features[
"atomic-ds-pk-add-16-insts"] =
true;
427 Features[
"atomic-flat-pk-add-16-insts"] =
true;
428 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
429 Features[
"gfx90a-insts"] =
true;
430 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
431 Features[
"atomic-fadd-rtn-insts"] =
true;
432 Features[
"dot3-insts"] =
true;
433 Features[
"dot4-insts"] =
true;
434 Features[
"dot5-insts"] =
true;
435 Features[
"dot6-insts"] =
true;
436 Features[
"mai-insts"] =
true;
437 Features[
"dl-insts"] =
true;
438 Features[
"dot1-insts"] =
true;
439 Features[
"dot2-insts"] =
true;
440 Features[
"dot7-insts"] =
true;
441 Features[
"dot10-insts"] =
true;
442 Features[
"gfx9-insts"] =
true;
443 Features[
"gfx8-insts"] =
true;
444 Features[
"16-bit-insts"] =
true;
445 Features[
"dpp"] =
true;
446 Features[
"s-memrealtime"] =
true;
447 Features[
"ci-insts"] =
true;
448 Features[
"s-memtime-inst"] =
true;
449 Features[
"gws"] =
true;
452 Features[
"gfx90a-insts"] =
true;
453 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
454 Features[
"atomic-fadd-rtn-insts"] =
true;
457 Features[
"dot3-insts"] =
true;
458 Features[
"dot4-insts"] =
true;
459 Features[
"dot5-insts"] =
true;
460 Features[
"dot6-insts"] =
true;
461 Features[
"mai-insts"] =
true;
464 Features[
"dl-insts"] =
true;
465 Features[
"dot1-insts"] =
true;
466 Features[
"dot2-insts"] =
true;
467 Features[
"dot7-insts"] =
true;
468 Features[
"dot10-insts"] =
true;
476 Features[
"gfx9-insts"] =
true;
483 Features[
"gfx8-insts"] =
true;
484 Features[
"16-bit-insts"] =
true;
485 Features[
"dpp"] =
true;
486 Features[
"s-memrealtime"] =
true;
494 Features[
"ci-insts"] =
true;
499 Features[
"image-insts"] =
true;
500 Features[
"s-memtime-inst"] =
true;
501 Features[
"gws"] =
true;
539 bool IsWave32Capable =
false;
566 IsWave32Capable =
true;
572 return IsWave32Capable;
577 std::string &ErrorMsg) {
579 const bool IsNullGPU = GPU.
empty();
581 const bool HaveWave32 =
582 (IsWave32Capable || IsNullGPU) && Features.
count(
"wavefrontsize32");
583 const bool HaveWave64 = Features.
count(
"wavefrontsize64");
584 if (HaveWave32 && HaveWave64) {
585 ErrorMsg =
"'wavefrontsize32' and 'wavefrontsize64' are mutually exclusive";
591 if (!HaveWave32 && !HaveWave64) {
593 IsWave32Capable ?
"wavefrontsize32" :
"wavefrontsize64";
594 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.
StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
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)
StringRef getArchFamilyNameAMDGCN(GPUKind AK)
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.