19using namespace AMDGPU;
30constexpr GPUInfo R600GPUs[] = {
63constexpr GPUInfo AMDGCNGPUs[] = {
142 return A.Kind <
B.Kind;
145 if (
I == Table.
end() ||
I->Kind != Search.Kind)
169 if (
const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
170 return Entry->CanonicalName;
175 if (
const auto *Entry = getArchEntry(AK, R600GPUs))
176 return Entry->CanonicalName;
181 for (
const auto &
C : AMDGCNGPUs) {
186 return AMDGPU::GPUKind::GK_NONE;
190 for (
const auto &
C : R600GPUs) {
195 return AMDGPU::GPUKind::GK_NONE;
199 if (
const auto *Entry = getArchEntry(AK, AMDGCNGPUs))
200 return Entry->Features;
205 if (
const auto *Entry = getArchEntry(AK, R600GPUs))
206 return Entry->Features;
212 for (
const auto &
C : AMDGCNGPUs)
217 for (
const auto &
C : R600GPUs)
223 if (AK == AMDGPU::GPUKind::GK_NONE) {
224 if (GPU ==
"generic-hsa")
226 if (GPU ==
"generic")
295 default:
return {0, 0, 0};
316 Features[
"ci-insts"] =
true;
317 Features[
"dot7-insts"] =
true;
318 Features[
"dot8-insts"] =
true;
319 Features[
"dot9-insts"] =
true;
320 Features[
"dot10-insts"] =
true;
321 Features[
"dot11-insts"] =
true;
322 Features[
"dl-insts"] =
true;
323 Features[
"atomic-ds-pk-add-16-insts"] =
true;
324 Features[
"atomic-flat-pk-add-16-insts"] =
true;
325 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
326 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
327 Features[
"16-bit-insts"] =
true;
328 Features[
"dpp"] =
true;
329 Features[
"gfx8-insts"] =
true;
330 Features[
"gfx9-insts"] =
true;
331 Features[
"gfx10-insts"] =
true;
332 Features[
"gfx10-3-insts"] =
true;
333 Features[
"gfx11-insts"] =
true;
334 Features[
"gfx12-insts"] =
true;
335 Features[
"atomic-fadd-rtn-insts"] =
true;
336 Features[
"image-insts"] =
true;
337 Features[
"fp8-conversion-insts"] =
true;
346 Features[
"ci-insts"] =
true;
347 Features[
"dot5-insts"] =
true;
348 Features[
"dot7-insts"] =
true;
349 Features[
"dot8-insts"] =
true;
350 Features[
"dot9-insts"] =
true;
351 Features[
"dot10-insts"] =
true;
352 Features[
"dl-insts"] =
true;
353 Features[
"16-bit-insts"] =
true;
354 Features[
"dpp"] =
true;
355 Features[
"gfx8-insts"] =
true;
356 Features[
"gfx9-insts"] =
true;
357 Features[
"gfx10-insts"] =
true;
358 Features[
"gfx10-3-insts"] =
true;
359 Features[
"gfx11-insts"] =
true;
360 Features[
"atomic-fadd-rtn-insts"] =
true;
361 Features[
"image-insts"] =
true;
362 Features[
"gws"] =
true;
372 Features[
"ci-insts"] =
true;
373 Features[
"dot1-insts"] =
true;
374 Features[
"dot2-insts"] =
true;
375 Features[
"dot5-insts"] =
true;
376 Features[
"dot6-insts"] =
true;
377 Features[
"dot7-insts"] =
true;
378 Features[
"dot10-insts"] =
true;
379 Features[
"dl-insts"] =
true;
380 Features[
"16-bit-insts"] =
true;
381 Features[
"dpp"] =
true;
382 Features[
"gfx8-insts"] =
true;
383 Features[
"gfx9-insts"] =
true;
384 Features[
"gfx10-insts"] =
true;
385 Features[
"gfx10-3-insts"] =
true;
386 Features[
"image-insts"] =
true;
387 Features[
"s-memrealtime"] =
true;
388 Features[
"s-memtime-inst"] =
true;
389 Features[
"gws"] =
true;
393 Features[
"dot1-insts"] =
true;
394 Features[
"dot2-insts"] =
true;
395 Features[
"dot5-insts"] =
true;
396 Features[
"dot6-insts"] =
true;
397 Features[
"dot7-insts"] =
true;
398 Features[
"dot10-insts"] =
true;
403 Features[
"dl-insts"] =
true;
404 Features[
"ci-insts"] =
true;
405 Features[
"16-bit-insts"] =
true;
406 Features[
"dpp"] =
true;
407 Features[
"gfx8-insts"] =
true;
408 Features[
"gfx9-insts"] =
true;
409 Features[
"gfx10-insts"] =
true;
410 Features[
"image-insts"] =
true;
411 Features[
"s-memrealtime"] =
true;
412 Features[
"s-memtime-inst"] =
true;
413 Features[
"gws"] =
true;
418 Features[
"gfx940-insts"] =
true;
419 Features[
"fp8-insts"] =
true;
420 Features[
"fp8-conversion-insts"] =
true;
421 Features[
"atomic-ds-pk-add-16-insts"] =
true;
422 Features[
"atomic-flat-pk-add-16-insts"] =
true;
423 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
424 Features[
"gfx90a-insts"] =
true;
425 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
426 Features[
"atomic-fadd-rtn-insts"] =
true;
427 Features[
"dot3-insts"] =
true;
428 Features[
"dot4-insts"] =
true;
429 Features[
"dot5-insts"] =
true;
430 Features[
"dot6-insts"] =
true;
431 Features[
"mai-insts"] =
true;
432 Features[
"dl-insts"] =
true;
433 Features[
"dot1-insts"] =
true;
434 Features[
"dot2-insts"] =
true;
435 Features[
"dot7-insts"] =
true;
436 Features[
"dot10-insts"] =
true;
437 Features[
"gfx9-insts"] =
true;
438 Features[
"gfx8-insts"] =
true;
439 Features[
"16-bit-insts"] =
true;
440 Features[
"dpp"] =
true;
441 Features[
"s-memrealtime"] =
true;
442 Features[
"ci-insts"] =
true;
443 Features[
"s-memtime-inst"] =
true;
444 Features[
"gws"] =
true;
447 Features[
"gfx90a-insts"] =
true;
448 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
449 Features[
"atomic-fadd-rtn-insts"] =
true;
452 Features[
"dot3-insts"] =
true;
453 Features[
"dot4-insts"] =
true;
454 Features[
"dot5-insts"] =
true;
455 Features[
"dot6-insts"] =
true;
456 Features[
"mai-insts"] =
true;
459 Features[
"dl-insts"] =
true;
460 Features[
"dot1-insts"] =
true;
461 Features[
"dot2-insts"] =
true;
462 Features[
"dot7-insts"] =
true;
463 Features[
"dot10-insts"] =
true;
471 Features[
"gfx9-insts"] =
true;
478 Features[
"gfx8-insts"] =
true;
479 Features[
"16-bit-insts"] =
true;
480 Features[
"dpp"] =
true;
481 Features[
"s-memrealtime"] =
true;
489 Features[
"ci-insts"] =
true;
494 Features[
"image-insts"] =
true;
495 Features[
"s-memtime-inst"] =
true;
496 Features[
"gws"] =
true;
534 bool IsWave32Capable =
false;
560 IsWave32Capable =
true;
566 return IsWave32Capable;
571 std::string &ErrorMsg) {
573 const bool IsNullGPU = GPU.
empty();
575 const bool HaveWave32 =
576 (IsWave32Capable || IsNullGPU) && Features.
count(
"wavefrontsize32");
577 const bool HaveWave64 = Features.
count(
"wavefrontsize64");
578 if (HaveWave32 && HaveWave64) {
579 ErrorMsg =
"'wavefrontsize32' and 'wavefrontsize64' are mutually exclusive";
585 if (!HaveWave32 && !HaveWave64) {
587 IsWave32Capable ?
"wavefrontsize32" :
"wavefrontsize64";
588 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.