28 "Generic AMDGCN arch not classified correctly!");
38#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
41#include "llvm/TargetParser/AMDGPUTargetParser.def"
50#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
53#include "llvm/TargetParser/AMDGPUTargetParser.def"
127 return MajorA == MajorB;
129 return MajorA == MajorB;
154 return A.getArchName().size() == 6;
157 return B.getArchName().size() == 6;
172 if (
A.getSubArch() == MajorA) {
173 if (MajorA == MajorB)
177 if (
B.getSubArch() == MajorB) {
178 if (MajorA == MajorB)
188#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
191#include "llvm/TargetParser/AMDGPUTargetParser.def"
202 "gfx600",
"gfx601",
"gfx602",
205 "gfx700",
"gfx701",
"gfx702",
"gfx703",
"gfx704",
209 "gfx801",
"gfx802",
"gfx803",
"gfx805",
213 "gfx9-generic",
"gfx900",
"gfx902",
"gfx904",
"gfx906",
218 "gfx9-4-generic",
"gfx942",
"gfx950",
220 "gfx10-1-generic",
"gfx1010",
"gfx1011",
"gfx1012",
"gfx1013",
222 "gfx10-3-generic",
"gfx1030",
"gfx1031",
"gfx1032",
"gfx1033",
223 "gfx1034",
"gfx1035",
"gfx1036",
225 "gfx11-generic",
"gfx1100",
"gfx1101",
"gfx1102",
"gfx1103",
226 "gfx1150",
"gfx1151",
"gfx1152",
"gfx1153",
"gfx1154",
228 "gfx11-7-generic",
"gfx1170",
"gfx1171",
"gfx1172",
230 "gfx12-generic",
"gfx1200",
"gfx1201",
"gfx12-5-generic",
"gfx1250",
233 "gfx13-generic",
"gfx1310"};
244#define R600_GPU(NAME, ENUM, FEATURES) \
247#include "llvm/TargetParser/AMDGPUTargetParser.def"
255#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) .Case(NAME, ENUM)
256#define AMDGCN_GPU_ALIAS(NAME, ENUM) .Case(NAME, ENUM)
257#include "llvm/TargetParser/AMDGPUTargetParser.def"
258 .
Case(
"generic", AMDGPU::GPUKind::GK_GFX600)
259 .
Case(
"generic-hsa", AMDGPU::GPUKind::GK_GFX700)
265#define R600_GPU(NAME, ENUM, FEATURES) .Case(NAME, ENUM)
266#define R600_GPU_ALIAS(NAME, ENUM) .Case(NAME, ENUM)
267#include "llvm/TargetParser/AMDGPUTargetParser.def"
273#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
276#include "llvm/TargetParser/AMDGPUTargetParser.def"
284#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
287#include "llvm/TargetParser/AMDGPUTargetParser.def"
295#define R600_GPU(NAME, ENUM, FEATURES) \
298#include "llvm/TargetParser/AMDGPUTargetParser.def"
308#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
309 if (isCPUValidForSubArch(SubArch, ENUM)) \
310 Values.push_back(NAME);
311#define AMDGCN_GPU_ALIAS(NAME, ENUM) \
312 if (isCPUValidForSubArch(SubArch, ENUM)) \
313 Values.push_back(NAME);
314#include "llvm/TargetParser/AMDGPUTargetParser.def"
319#define R600_GPU(NAME, ENUM, FEATURES) NAME,
320#define R600_GPU_ALIAS(NAME, ENUM) NAME,
321#include "llvm/TargetParser/AMDGPUTargetParser.def"
328 if (GPU ==
"generic-hsa")
330 if (GPU ==
"generic")
336#define MAKE_ISAVERSION(A, B, C) {A, B, C}
337#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
339 return MAKE_ISAVERSION ISAVERSION;
340#include "llvm/TargetParser/AMDGPUTargetParser.def"
341#undef MAKE_ISAVERSION
349#define MAKE_ISAVERSION(A, B, C) {A, B, C}
350#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
352 return MAKE_ISAVERSION ISAVERSION;
353#include "llvm/TargetParser/AMDGPUTargetParser.def"
354#undef MAKE_ISAVERSION
369static std::pair<FeatureError, StringRef>
373 const bool IsNullGPU = GPU.
empty();
374 const bool TargetHasWave32 = DefaultFeatures.
count(
"wavefrontsize32");
375 const bool TargetHasWave64 = DefaultFeatures.
count(
"wavefrontsize64");
377 auto Wave32Itr = Features.
find(
"wavefrontsize32");
378 auto Wave64Itr = Features.
find(
"wavefrontsize64");
379 const bool EnableWave32 =
380 Wave32Itr != Features.
end() && Wave32Itr->getValue();
381 const bool EnableWave64 =
382 Wave64Itr != Features.
end() && Wave64Itr->getValue();
383 const bool DisableWave32 =
384 Wave32Itr != Features.
end() && !Wave32Itr->getValue();
385 const bool DisableWave64 =
386 Wave64Itr != Features.
end() && !Wave64Itr->getValue();
388 if (EnableWave32 && EnableWave64)
390 "'+wavefrontsize32' and '+wavefrontsize64' are mutually exclusive"};
391 if (DisableWave32 && DisableWave64)
393 "'-wavefrontsize32' and '-wavefrontsize64' are mutually exclusive"};
396 if (TargetHasWave64) {
403 if (TargetHasWave32) {
413 if (!IsNullGPU && !EnableWave32 && !EnableWave64 && !TargetHasWave32 &&
415 Features.
insert(std::make_pair(
"wavefrontsize32",
true));
417 for (
const auto &Entry : DefaultFeatures) {
418 if (!Features.
count(Entry.getKey()))
419 Features[Entry.getKey()] = Entry.getValue();
433 Features[
"gfx1251-gemm-insts"] =
true;
436 Features[
"swmmac-gfx1200-insts"] =
true;
437 Features[
"swmmac-gfx1250-insts"] =
true;
440 case GK_GFX13_GENERIC:
441 Features[
"cube-insts"] =
true;
442 Features[
"cvt-pknorm-vop2-insts"] =
true;
443 Features[
"lerp-inst"] =
true;
444 Features[
"qsad-insts"] =
true;
445 Features[
"sad-insts"] =
true;
446 Features[
"msad-insts"] =
true;
447 Features[
"mqsad-pk-insts"] =
true;
448 Features[
"mqsad-insts"] =
true;
450 case GK_GFX12_5_GENERIC:
451 Features[
"ci-insts"] =
true;
452 Features[
"dot7-insts"] =
true;
453 Features[
"dot8-insts"] =
true;
454 Features[
"dl-insts"] =
true;
455 Features[
"16-bit-insts"] =
true;
456 Features[
"dpp"] =
true;
457 Features[
"gfx8-insts"] =
true;
458 Features[
"gfx9-insts"] =
true;
459 Features[
"flat-global-insts"] =
true;
460 Features[
"gfx10-insts"] =
true;
461 Features[
"gfx10-3-insts"] =
true;
462 Features[
"gfx11-insts"] =
true;
463 Features[
"gfx12-insts"] =
true;
464 Features[
"gfx1250-insts"] =
true;
465 Features[
"bitop3-insts"] =
true;
466 Features[
"prng-inst"] =
true;
467 Features[
"tanh-insts"] =
true;
468 Features[
"tensor-cvt-lut-insts"] =
true;
469 Features[
"transpose-load-f4f6-insts"] =
true;
470 Features[
"bf16-trans-insts"] =
true;
471 Features[
"bf16-cvt-insts"] =
true;
472 Features[
"bf16-pk-insts"] =
true;
473 Features[
"fp8-conversion-insts"] =
true;
474 Features[
"fp8e5m3-insts"] =
true;
475 Features[
"permlane16-swap"] =
true;
476 Features[
"ashr-pk-insts"] =
true;
477 Features[
"add-min-max-insts"] =
true;
478 Features[
"pk-add-min-max-insts"] =
true;
479 Features[
"atomic-buffer-pk-add-bf16-inst"] =
true;
480 Features[
"vmem-pref-insts"] =
true;
481 Features[
"atomic-fadd-rtn-insts"] =
true;
482 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
483 Features[
"atomic-flat-pk-add-16-insts"] =
true;
484 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
485 Features[
"atomic-ds-pk-add-16-insts"] =
true;
486 Features[
"setprio-inc-wg-inst"] =
true;
487 Features[
"s-wakeup-barrier-inst"] =
true;
488 Features[
"atomic-fmin-fmax-global-f32"] =
true;
489 Features[
"atomic-fmin-fmax-global-f64"] =
true;
490 Features[
"wavefrontsize32"] =
true;
491 Features[
"clusters"] =
true;
492 Features[
"mcast-load-insts"] =
true;
493 Features[
"asynccnt"] =
true;
497 case GK_GFX12_GENERIC:
498 Features[
"ci-insts"] =
true;
499 Features[
"dot7-insts"] =
true;
500 Features[
"dot8-insts"] =
true;
501 Features[
"dot9-insts"] =
true;
502 Features[
"dot10-insts"] =
true;
503 Features[
"dot11-insts"] =
true;
504 Features[
"dot12-insts"] =
true;
505 Features[
"dl-insts"] =
true;
506 Features[
"atomic-ds-pk-add-16-insts"] =
true;
507 Features[
"atomic-flat-pk-add-16-insts"] =
true;
508 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
509 Features[
"atomic-buffer-pk-add-bf16-inst"] =
true;
510 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
511 Features[
"16-bit-insts"] =
true;
512 Features[
"dpp"] =
true;
513 Features[
"gfx8-insts"] =
true;
514 Features[
"gfx9-insts"] =
true;
515 Features[
"flat-global-insts"] =
true;
516 Features[
"gfx10-insts"] =
true;
517 Features[
"gfx10-3-insts"] =
true;
518 Features[
"gfx11-insts"] =
true;
519 Features[
"gfx12-insts"] =
true;
520 Features[
"atomic-fadd-rtn-insts"] =
true;
521 Features[
"image-insts"] =
true;
522 Features[
"cube-insts"] =
true;
523 Features[
"lerp-inst"] =
true;
524 Features[
"sad-insts"] =
true;
525 Features[
"qsad-insts"] =
true;
526 Features[
"msad-insts"] =
true;
527 Features[
"mqsad-pk-insts"] =
true;
528 Features[
"mqsad-insts"] =
true;
529 Features[
"cvt-pknorm-vop2-insts"] =
true;
530 Features[
"fp8-conversion-insts"] =
true;
531 Features[
"wmma-128b-insts"] =
true;
532 Features[
"swmmac-gfx1200-insts"] =
true;
533 Features[
"atomic-fmin-fmax-global-f32"] =
true;
538 case GK_GFX11_7_GENERIC:
539 Features[
"ci-insts"] =
true;
540 Features[
"dot7-insts"] =
true;
541 Features[
"dot8-insts"] =
true;
542 Features[
"dot9-insts"] =
true;
543 Features[
"dot10-insts"] =
true;
544 Features[
"dot12-insts"] =
true;
545 Features[
"dl-insts"] =
true;
546 Features[
"16-bit-insts"] =
true;
547 Features[
"dpp"] =
true;
548 Features[
"gfx8-insts"] =
true;
549 Features[
"gfx9-insts"] =
true;
550 Features[
"flat-global-insts"] =
true;
551 Features[
"gfx10-insts"] =
true;
552 Features[
"gfx10-3-insts"] =
true;
553 Features[
"gfx11-insts"] =
true;
554 Features[
"atomic-fadd-rtn-insts"] =
true;
555 Features[
"image-insts"] =
true;
556 Features[
"cube-insts"] =
true;
557 Features[
"lerp-inst"] =
true;
558 Features[
"sad-insts"] =
true;
559 Features[
"qsad-insts"] =
true;
560 Features[
"msad-insts"] =
true;
561 Features[
"mqsad-pk-insts"] =
true;
562 Features[
"mqsad-insts"] =
true;
563 Features[
"cvt-pknorm-vop2-insts"] =
true;
564 Features[
"gws"] =
true;
565 Features[
"dot11-insts"] =
true;
566 Features[
"fp8-conversion-insts"] =
true;
567 Features[
"wmma-128b-insts"] =
true;
568 Features[
"swmmac-gfx1200-insts"] =
true;
569 Features[
"atomic-fmin-fmax-global-f32"] =
true;
580 case GK_GFX11_GENERIC:
581 Features[
"ci-insts"] =
true;
582 Features[
"dot5-insts"] =
true;
583 Features[
"dot7-insts"] =
true;
584 Features[
"dot8-insts"] =
true;
585 Features[
"dot9-insts"] =
true;
586 Features[
"dot10-insts"] =
true;
587 Features[
"dot12-insts"] =
true;
588 Features[
"dl-insts"] =
true;
589 Features[
"16-bit-insts"] =
true;
590 Features[
"dpp"] =
true;
591 Features[
"gfx8-insts"] =
true;
592 Features[
"gfx9-insts"] =
true;
593 Features[
"flat-global-insts"] =
true;
594 Features[
"gfx10-insts"] =
true;
595 Features[
"gfx10-3-insts"] =
true;
596 Features[
"gfx11-insts"] =
true;
597 Features[
"atomic-fadd-rtn-insts"] =
true;
598 Features[
"image-insts"] =
true;
599 Features[
"cube-insts"] =
true;
600 Features[
"lerp-inst"] =
true;
601 Features[
"sad-insts"] =
true;
602 Features[
"qsad-insts"] =
true;
603 Features[
"msad-insts"] =
true;
604 Features[
"mqsad-pk-insts"] =
true;
605 Features[
"mqsad-insts"] =
true;
606 Features[
"cvt-pknorm-vop2-insts"] =
true;
607 Features[
"gws"] =
true;
608 Features[
"wmma-256b-insts"] =
true;
609 Features[
"atomic-fmin-fmax-global-f32"] =
true;
618 case GK_GFX10_3_GENERIC:
619 Features[
"ci-insts"] =
true;
620 Features[
"dot1-insts"] =
true;
621 Features[
"dot2-insts"] =
true;
622 Features[
"dot5-insts"] =
true;
623 Features[
"dot6-insts"] =
true;
624 Features[
"dot7-insts"] =
true;
625 Features[
"dot10-insts"] =
true;
626 Features[
"dl-insts"] =
true;
627 Features[
"16-bit-insts"] =
true;
628 Features[
"dpp"] =
true;
629 Features[
"gfx8-insts"] =
true;
630 Features[
"gfx9-insts"] =
true;
631 Features[
"flat-global-insts"] =
true;
632 Features[
"gfx10-insts"] =
true;
633 Features[
"gfx10-3-insts"] =
true;
634 Features[
"image-insts"] =
true;
635 Features[
"s-memrealtime"] =
true;
636 Features[
"s-memtime-inst"] =
true;
637 Features[
"gws"] =
true;
638 Features[
"vmem-to-lds-load-insts"] =
true;
639 Features[
"atomic-fmin-fmax-global-f32"] =
true;
640 Features[
"atomic-fmin-fmax-global-f64"] =
true;
641 Features[
"cube-insts"] =
true;
642 Features[
"lerp-inst"] =
true;
643 Features[
"sad-insts"] =
true;
644 Features[
"qsad-insts"] =
true;
645 Features[
"msad-insts"] =
true;
646 Features[
"mqsad-pk-insts"] =
true;
647 Features[
"mqsad-insts"] =
true;
648 Features[
"cvt-pknorm-vop2-insts"] =
true;
652 Features[
"dot1-insts"] =
true;
653 Features[
"dot2-insts"] =
true;
654 Features[
"dot5-insts"] =
true;
655 Features[
"dot6-insts"] =
true;
656 Features[
"dot7-insts"] =
true;
657 Features[
"dot10-insts"] =
true;
661 case GK_GFX10_1_GENERIC:
662 Features[
"dl-insts"] =
true;
663 Features[
"ci-insts"] =
true;
664 Features[
"16-bit-insts"] =
true;
665 Features[
"dpp"] =
true;
666 Features[
"gfx8-insts"] =
true;
667 Features[
"gfx9-insts"] =
true;
668 Features[
"flat-global-insts"] =
true;
669 Features[
"gfx10-insts"] =
true;
670 Features[
"image-insts"] =
true;
671 Features[
"s-memrealtime"] =
true;
672 Features[
"s-memtime-inst"] =
true;
673 Features[
"gws"] =
true;
674 Features[
"vmem-to-lds-load-insts"] =
true;
675 Features[
"atomic-fmin-fmax-global-f32"] =
true;
676 Features[
"atomic-fmin-fmax-global-f64"] =
true;
677 Features[
"cube-insts"] =
true;
678 Features[
"lerp-inst"] =
true;
679 Features[
"sad-insts"] =
true;
680 Features[
"qsad-insts"] =
true;
681 Features[
"msad-insts"] =
true;
682 Features[
"mqsad-pk-insts"] =
true;
683 Features[
"mqsad-insts"] =
true;
684 Features[
"cvt-pknorm-vop2-insts"] =
true;
687 Features[
"bitop3-insts"] =
true;
688 Features[
"fp6bf6-cvt-scale-insts"] =
true;
689 Features[
"fp4-cvt-scale-insts"] =
true;
690 Features[
"bf8-cvt-scale-insts"] =
true;
691 Features[
"fp8-cvt-scale-insts"] =
true;
692 Features[
"f16bf16-to-fp6bf6-cvt-scale-insts"] =
true;
693 Features[
"f32-to-f16bf16-cvt-sr-insts"] =
true;
694 Features[
"prng-inst"] =
true;
695 Features[
"permlane16-swap"] =
true;
696 Features[
"permlane32-swap"] =
true;
697 Features[
"ashr-pk-insts"] =
true;
698 Features[
"dot12-insts"] =
true;
699 Features[
"dot13-insts"] =
true;
700 Features[
"atomic-buffer-pk-add-bf16-inst"] =
true;
701 Features[
"gfx950-insts"] =
true;
704 Features[
"fp8-insts"] =
true;
705 Features[
"fp8-conversion-insts"] =
true;
706 if (Kind != GK_GFX950)
707 Features[
"xf32-insts"] =
true;
709 case GK_GFX9_4_GENERIC:
710 Features[
"gfx940-insts"] =
true;
711 Features[
"atomic-ds-pk-add-16-insts"] =
true;
712 Features[
"atomic-flat-pk-add-16-insts"] =
true;
713 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
714 Features[
"gfx90a-insts"] =
true;
715 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
716 Features[
"atomic-fadd-rtn-insts"] =
true;
717 Features[
"dot3-insts"] =
true;
718 Features[
"dot4-insts"] =
true;
719 Features[
"dot5-insts"] =
true;
720 Features[
"dot6-insts"] =
true;
721 Features[
"mai-insts"] =
true;
722 Features[
"dl-insts"] =
true;
723 Features[
"dot1-insts"] =
true;
724 Features[
"dot2-insts"] =
true;
725 Features[
"dot7-insts"] =
true;
726 Features[
"dot10-insts"] =
true;
727 Features[
"gfx9-insts"] =
true;
728 Features[
"flat-global-insts"] =
true;
729 Features[
"gfx8-insts"] =
true;
730 Features[
"16-bit-insts"] =
true;
731 Features[
"dpp"] =
true;
732 Features[
"s-memrealtime"] =
true;
733 Features[
"ci-insts"] =
true;
734 Features[
"s-memtime-inst"] =
true;
735 Features[
"gws"] =
true;
736 Features[
"vmem-to-lds-load-insts"] =
true;
737 Features[
"atomic-fmin-fmax-global-f64"] =
true;
738 Features[
"wavefrontsize64"] =
true;
739 Features[
"cube-insts"] =
true;
740 Features[
"lerp-inst"] =
true;
741 Features[
"sad-insts"] =
true;
742 Features[
"qsad-insts"] =
true;
743 Features[
"msad-insts"] =
true;
744 Features[
"mqsad-pk-insts"] =
true;
745 Features[
"mqsad-insts"] =
true;
746 Features[
"cvt-pknorm-vop2-insts"] =
true;
749 Features[
"gfx90a-insts"] =
true;
750 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
751 Features[
"atomic-fadd-rtn-insts"] =
true;
752 Features[
"atomic-fmin-fmax-global-f64"] =
true;
755 Features[
"dot3-insts"] =
true;
756 Features[
"dot4-insts"] =
true;
757 Features[
"dot5-insts"] =
true;
758 Features[
"dot6-insts"] =
true;
759 Features[
"mai-insts"] =
true;
762 Features[
"dl-insts"] =
true;
763 Features[
"dot1-insts"] =
true;
764 Features[
"dot2-insts"] =
true;
765 Features[
"dot7-insts"] =
true;
766 Features[
"dot10-insts"] =
true;
773 case GK_GFX9_GENERIC:
774 Features[
"gfx9-insts"] =
true;
775 Features[
"flat-global-insts"] =
true;
776 Features[
"vmem-to-lds-load-insts"] =
true;
783 Features[
"gfx8-insts"] =
true;
784 Features[
"16-bit-insts"] =
true;
785 Features[
"dpp"] =
true;
786 Features[
"s-memrealtime"] =
true;
787 Features[
"ci-insts"] =
true;
788 Features[
"image-insts"] =
true;
789 Features[
"s-memtime-inst"] =
true;
790 Features[
"gws"] =
true;
791 Features[
"wavefrontsize64"] =
true;
792 Features[
"cube-insts"] =
true;
793 Features[
"lerp-inst"] =
true;
794 Features[
"sad-insts"] =
true;
795 Features[
"qsad-insts"] =
true;
796 Features[
"msad-insts"] =
true;
797 Features[
"mqsad-pk-insts"] =
true;
798 Features[
"mqsad-insts"] =
true;
799 Features[
"cvt-pknorm-vop2-insts"] =
true;
807 Features[
"ci-insts"] =
true;
808 Features[
"cube-insts"] =
true;
809 Features[
"lerp-inst"] =
true;
810 Features[
"sad-insts"] =
true;
811 Features[
"qsad-insts"] =
true;
812 Features[
"msad-insts"] =
true;
813 Features[
"mqsad-pk-insts"] =
true;
814 Features[
"mqsad-insts"] =
true;
815 Features[
"cvt-pknorm-vop2-insts"] =
true;
816 Features[
"image-insts"] =
true;
817 Features[
"s-memtime-inst"] =
true;
818 Features[
"gws"] =
true;
819 Features[
"atomic-fmin-fmax-global-f32"] =
true;
820 Features[
"atomic-fmin-fmax-global-f64"] =
true;
821 Features[
"wavefrontsize64"] =
true;
826 Features[
"image-insts"] =
true;
827 Features[
"s-memtime-inst"] =
true;
828 Features[
"gws"] =
true;
829 Features[
"atomic-fmin-fmax-global-f32"] =
true;
830 Features[
"atomic-fmin-fmax-global-f64"] =
true;
831 Features[
"wavefrontsize64"] =
true;
832 Features[
"cube-insts"] =
true;
833 Features[
"lerp-inst"] =
true;
834 Features[
"sad-insts"] =
true;
835 Features[
"msad-insts"] =
true;
836 Features[
"mqsad-pk-insts"] =
true;
837 Features[
"cvt-pknorm-vop2-insts"] =
true;
849std::pair<FeatureError, StringRef>
858 static const Triple AMDGCN(
"amdgcn-amd-amdhsa");
860 for (
auto &&GPU : GPUs) {
862 for (
auto &&[
F,
B] : Tmp)
865 Features[
"wavefrontsize32"] =
true;
866 Features[
"wavefrontsize64"] =
true;
867 }
else if (
T.isAMDGCN()) {
905 TargetTripleString(TT.normalize(
Triple::CanonicalForm::FOUR_IDENT)),
906 XnackSetting(XnackSetting), SramEccSetting(SramEccSetting),
907 IsAMDHSA(TT.getOS() ==
Triple::AMDHSA) {}
912 return TargetIDSetting::Off;
914 return TargetIDSetting::On;
923 return (CPUName.
empty() || CPUName ==
"generic")
935 XnackSetting = TargetIDSetting::Any;
937 SramEccSetting = TargetIDSetting::Any;
945 for (
const auto &FeatureString : TargetIDSplit) {
946 if (FeatureString.starts_with(
"xnack"))
948 if (FeatureString.starts_with(
"sramecc"))
953std::optional<TargetID>
958 TargetIDDirective.
split(Parts,
'-', 4);
959 if (Parts.
size() < 4)
962 Triple TT(Parts[0], Parts[1], Parts[2], Parts[3]);
978 StreamRep <<
":sramecc-";
980 StreamRep <<
":sramecc+";
984 StreamRep <<
":xnack-";
986 StreamRep <<
":xnack+";
998 return Arch ==
Other.Arch && XnackSetting ==
Other.XnackSetting &&
999 SramEccSetting ==
Other.SramEccSetting && IsAMDHSA ==
Other.IsAMDHSA &&
1000 TargetTripleString ==
Other.TargetTripleString;
1004 return A == TargetIDSetting::Any ||
B == TargetIDSetting::Any ||
A ==
B;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GPUKind getGPUKindFromTargetID(const Triple &TT, StringRef TargetIDStr)
static void fillAMDGCNFeatureMap(StringRef GPU, const Triple &T, StringMap< bool > &Features)
Fills Features map with default values for given target GPU.
static const StringLiteral AMDGPUSubArchNames[Triple::LastAMDGPUSubArch - Triple::FirstAMDGPUSubArch+1]
static TargetIDSetting getTargetIDSettingFromFeatureString(StringRef FeatureString)
static const Triple::SubArchType AMDGPUMajorFamilies[Triple::LastAMDGPUSubArch - Triple::FirstAMDGPUSubArch+1]
static bool areFeatureSettingsCompatible(TargetIDSetting A, TargetIDSetting B)
static std::pair< FeatureError, StringRef > insertWaveSizeFeature(StringRef GPU, const Triple &T, const StringMap< bool > &DefaultFeatures, StringMap< bool > &Features)
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
This file defines the SmallVector class.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static std::optional< TargetID > parseTargetIDString(StringRef TargetIDDirective)
void print(raw_ostream &OS) const
bool isCompatibleWith(const TargetID &Other) const
Returns true if a device image built for *this can satisfy a request for Other (i....
TargetIDSetting getXnackSetting() const
void setTargetIDFromTargetIDStream(StringRef TargetID)
bool operator==(const TargetID &Other) const
StringRef getTargetTripleString() const
TargetID(GPUKind Arch, const Triple &TT, TargetIDSetting XnackSetting, TargetIDSetting SramEccSetting)
std::string toString() const
TargetIDSetting getSramEccSetting() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
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",...
iterator find(StringRef Key)
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.
Represent a constant reference to a string, i.e.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
constexpr bool empty() const
Check if the string is empty.
StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
size_t find(char C, size_t From=0) const
Search for the first character C in the string.
bool ends_with(StringRef Suffix) const
Check if this string ends with the given Suffix.
StringRef drop_back(size_t N=1) const
Return a StringRef equal to 'this' but with the last N elements dropped.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Triple - Helper class for working with autoconf configuration names.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI StringRef getArchNameR600(GPUKind AK)
LLVM_ABI void fillValidArchListAMDGCN(SmallVectorImpl< StringRef > &Values, Triple::SubArchType SubArch=Triple::NoSubArch)
Append the valid AMDGCN GPU names to Values.
GPUKind
GPU kinds supported by the AMDGPU target.
@ GK_AMDGCN_GENERIC_FIRST
LLVM_ABI StringRef getCanonicalArchName(const Triple &T, StringRef Arch)
LLVM_ABI void fillValidArchListR600(SmallVectorImpl< StringRef > &Values)
LLVM_ABI std::string mergeSubArch(const Triple &A, const Triple &B)
Returns the effective triple appropriate to use when linking B into A by merging the subarches in cas...
LLVM_ABI bool isCPUValidForSubArch(Triple::SubArchType SubArch, GPUKind AK)
Return true if the GPU AK is usable with the triple subarch SubArch.
LLVM_ABI bool isSubArchCompatible(const Triple &A, const Triple &B)
Return true if subarch A is compatible with subarch B, i.e.
LLVM_ABI StringRef getArchFamilyNameAMDGCN(GPUKind AK)
LLVM_ABI IsaVersion getIsaVersion(StringRef GPU)
LLVM_ABI Triple::SubArchType getSubArch(GPUKind AK)
LLVM_ABI StringRef getArchNameFromSubArch(Triple::SubArchType SubArch)
Returns the canonical GPU name for an AMDGPU subarch, e.g.
LLVM_ABI GPUKind parseArchAMDGCN(StringRef CPU)
@ UNSUPPORTED_TARGET_FEATURE
@ INVALID_FEATURE_COMBINATION
LLVM_ABI GPUKind getGPUKindFromSubArch(Triple::SubArchType SubArch)
AMDGPU::TargetID TargetID
LLVM_ABI std::pair< FeatureError, StringRef > fillAMDGPUFeatureMap(StringRef GPU, const Triple &T, StringMap< bool > &Features)
Fills Features map with default values for given target GPU.
LLVM_ABI StringRef getArchNameAMDGCN(GPUKind AK)
LLVM_ABI unsigned getArchAttrAMDGCN(GPUKind AK)
LLVM_ABI Triple::SubArchType getMajorSubArch(Triple::SubArchType SubArch)
LLVM_ABI unsigned getArchAttrR600(GPUKind AK)
LLVM_ABI GPUKind parseArchR600(StringRef CPU)
This is an optimization pass for GlobalISel generic memory operations.
RelativeUniformCounterPtr Values
Instruction set architecture version.