29 "Generic AMDGCN arch not classified correctly!");
39#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
42#include "llvm/TargetParser/AMDGPUTargetParser.def"
51#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
54#include "llvm/TargetParser/AMDGPUTargetParser.def"
128 return MajorA == MajorB;
130 return MajorA == MajorB;
155 return A.getArchName().size() == 6;
158 return B.getArchName().size() == 6;
173 if (
A.getSubArch() == MajorA) {
174 if (MajorA == MajorB)
178 if (
B.getSubArch() == MajorB) {
179 if (MajorA == MajorB)
189#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
192#include "llvm/TargetParser/AMDGPUTargetParser.def"
203 "gfx600",
"gfx601",
"gfx602",
206 "gfx700",
"gfx701",
"gfx702",
"gfx703",
"gfx704",
210 "gfx801",
"gfx802",
"gfx803",
"gfx805",
214 "gfx9-generic",
"gfx900",
"gfx902",
"gfx904",
"gfx906",
219 "gfx9-4-generic",
"gfx942",
"gfx950",
221 "gfx10-1-generic",
"gfx1010",
"gfx1011",
"gfx1012",
"gfx1013",
223 "gfx10-3-generic",
"gfx1030",
"gfx1031",
"gfx1032",
"gfx1033",
224 "gfx1034",
"gfx1035",
"gfx1036",
226 "gfx11-generic",
"gfx1100",
"gfx1101",
"gfx1102",
"gfx1103",
227 "gfx1150",
"gfx1151",
"gfx1152",
"gfx1153",
"gfx1154",
229 "gfx11-7-generic",
"gfx1170",
"gfx1171",
"gfx1172",
231 "gfx12-generic",
"gfx1200",
"gfx1201",
"gfx12-5-generic",
"gfx1250",
234 "gfx13-generic",
"gfx1310"};
245#define R600_GPU(NAME, ENUM, FEATURES) \
248#include "llvm/TargetParser/AMDGPUTargetParser.def"
256#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) .Case(NAME, ENUM)
257#define AMDGCN_GPU_ALIAS(NAME, ENUM) .Case(NAME, ENUM)
258#include "llvm/TargetParser/AMDGPUTargetParser.def"
259 .
Case(
"generic", AMDGPU::GPUKind::GK_GFX600)
260 .
Case(
"generic-hsa", AMDGPU::GPUKind::GK_GFX700)
266#define R600_GPU(NAME, ENUM, FEATURES) .Case(NAME, ENUM)
267#define R600_GPU_ALIAS(NAME, ENUM) .Case(NAME, ENUM)
268#include "llvm/TargetParser/AMDGPUTargetParser.def"
274#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
277#include "llvm/TargetParser/AMDGPUTargetParser.def"
285#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
288#include "llvm/TargetParser/AMDGPUTargetParser.def"
296#define R600_GPU(NAME, ENUM, FEATURES) \
299#include "llvm/TargetParser/AMDGPUTargetParser.def"
309#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
310 if (isCPUValidForSubArch(SubArch, ENUM)) \
311 Values.push_back(NAME);
312#define AMDGCN_GPU_ALIAS(NAME, ENUM) \
313 if (isCPUValidForSubArch(SubArch, ENUM)) \
314 Values.push_back(NAME);
315#include "llvm/TargetParser/AMDGPUTargetParser.def"
320#define R600_GPU(NAME, ENUM, FEATURES) NAME,
321#define R600_GPU_ALIAS(NAME, ENUM) NAME,
322#include "llvm/TargetParser/AMDGPUTargetParser.def"
329 if (GPU ==
"generic-hsa")
331 if (GPU ==
"generic")
337#define MAKE_ISAVERSION(A, B, C) {A, B, C}
338#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
340 return MAKE_ISAVERSION ISAVERSION;
341#include "llvm/TargetParser/AMDGPUTargetParser.def"
342#undef MAKE_ISAVERSION
350#define MAKE_ISAVERSION(A, B, C) {A, B, C}
351#define AMDGCN_GPU(NAME, ENUM, SUBARCH, ISAVERSION, FEATURES) \
353 return MAKE_ISAVERSION ISAVERSION;
354#include "llvm/TargetParser/AMDGPUTargetParser.def"
355#undef MAKE_ISAVERSION
370static std::pair<FeatureError, StringRef>
374 const bool IsNullGPU = GPU.
empty();
375 const bool TargetHasWave32 = DefaultFeatures.
count(
"wavefrontsize32");
376 const bool TargetHasWave64 = DefaultFeatures.
count(
"wavefrontsize64");
378 auto Wave32Itr = Features.
find(
"wavefrontsize32");
379 auto Wave64Itr = Features.
find(
"wavefrontsize64");
380 const bool EnableWave32 =
381 Wave32Itr != Features.
end() && Wave32Itr->getValue();
382 const bool EnableWave64 =
383 Wave64Itr != Features.
end() && Wave64Itr->getValue();
384 const bool DisableWave32 =
385 Wave32Itr != Features.
end() && !Wave32Itr->getValue();
386 const bool DisableWave64 =
387 Wave64Itr != Features.
end() && !Wave64Itr->getValue();
389 if (EnableWave32 && EnableWave64)
391 "'+wavefrontsize32' and '+wavefrontsize64' are mutually exclusive"};
392 if (DisableWave32 && DisableWave64)
394 "'-wavefrontsize32' and '-wavefrontsize64' are mutually exclusive"};
397 if (TargetHasWave64) {
404 if (TargetHasWave32) {
414 if (!IsNullGPU && !EnableWave32 && !EnableWave64 && !TargetHasWave32 &&
416 Features.
insert(std::make_pair(
"wavefrontsize32",
true));
418 for (
const auto &Entry : DefaultFeatures) {
419 if (!Features.
count(Entry.getKey()))
420 Features[Entry.getKey()] = Entry.getValue();
434 Features[
"gfx1251-gemm-insts"] =
true;
437 Features[
"swmmac-gfx1200-insts"] =
true;
438 Features[
"swmmac-gfx1250-insts"] =
true;
441 case GK_GFX13_GENERIC:
442 Features[
"cube-insts"] =
true;
443 Features[
"cvt-pknorm-vop2-insts"] =
true;
444 Features[
"lerp-inst"] =
true;
445 Features[
"qsad-insts"] =
true;
446 Features[
"sad-insts"] =
true;
447 Features[
"msad-insts"] =
true;
448 Features[
"mqsad-pk-insts"] =
true;
449 Features[
"mqsad-insts"] =
true;
451 case GK_GFX12_5_GENERIC:
452 Features[
"ci-insts"] =
true;
453 Features[
"dot7-insts"] =
true;
454 Features[
"dot8-insts"] =
true;
455 Features[
"dl-insts"] =
true;
456 Features[
"16-bit-insts"] =
true;
457 Features[
"dpp"] =
true;
458 Features[
"gfx8-insts"] =
true;
459 Features[
"gfx9-insts"] =
true;
460 Features[
"flat-global-insts"] =
true;
461 Features[
"gfx10-insts"] =
true;
462 Features[
"gfx10-3-insts"] =
true;
463 Features[
"gfx11-insts"] =
true;
464 Features[
"gfx12-insts"] =
true;
465 Features[
"gfx1250-insts"] =
true;
466 Features[
"bitop3-insts"] =
true;
467 Features[
"prng-inst"] =
true;
468 Features[
"tanh-insts"] =
true;
469 Features[
"tensor-cvt-lut-insts"] =
true;
470 Features[
"transpose-load-f4f6-insts"] =
true;
471 Features[
"bf16-trans-insts"] =
true;
472 Features[
"bf16-cvt-insts"] =
true;
473 Features[
"bf16-pk-insts"] =
true;
474 Features[
"fp8-conversion-insts"] =
true;
475 Features[
"fp8e5m3-insts"] =
true;
476 Features[
"permlane16-swap"] =
true;
477 Features[
"ashr-pk-insts"] =
true;
478 Features[
"add-min-max-insts"] =
true;
479 Features[
"pk-add-min-max-insts"] =
true;
480 Features[
"atomic-buffer-pk-add-bf16-inst"] =
true;
481 Features[
"vmem-pref-insts"] =
true;
482 Features[
"atomic-fadd-rtn-insts"] =
true;
483 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
484 Features[
"atomic-flat-pk-add-16-insts"] =
true;
485 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
486 Features[
"atomic-ds-pk-add-16-insts"] =
true;
487 Features[
"setprio-inc-wg-inst"] =
true;
488 Features[
"s-wakeup-barrier-inst"] =
true;
489 Features[
"atomic-fmin-fmax-global-f32"] =
true;
490 Features[
"atomic-fmin-fmax-global-f64"] =
true;
491 Features[
"wavefrontsize32"] =
true;
492 Features[
"clusters"] =
true;
493 Features[
"mcast-load-insts"] =
true;
494 Features[
"asynccnt"] =
true;
498 case GK_GFX12_GENERIC:
499 Features[
"ci-insts"] =
true;
500 Features[
"dot7-insts"] =
true;
501 Features[
"dot8-insts"] =
true;
502 Features[
"dot9-insts"] =
true;
503 Features[
"dot10-insts"] =
true;
504 Features[
"dot11-insts"] =
true;
505 Features[
"dot12-insts"] =
true;
506 Features[
"dl-insts"] =
true;
507 Features[
"atomic-ds-pk-add-16-insts"] =
true;
508 Features[
"atomic-flat-pk-add-16-insts"] =
true;
509 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
510 Features[
"atomic-buffer-pk-add-bf16-inst"] =
true;
511 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
512 Features[
"16-bit-insts"] =
true;
513 Features[
"dpp"] =
true;
514 Features[
"gfx8-insts"] =
true;
515 Features[
"gfx9-insts"] =
true;
516 Features[
"flat-global-insts"] =
true;
517 Features[
"gfx10-insts"] =
true;
518 Features[
"gfx10-3-insts"] =
true;
519 Features[
"gfx11-insts"] =
true;
520 Features[
"gfx12-insts"] =
true;
521 Features[
"atomic-fadd-rtn-insts"] =
true;
522 Features[
"image-insts"] =
true;
523 Features[
"cube-insts"] =
true;
524 Features[
"lerp-inst"] =
true;
525 Features[
"sad-insts"] =
true;
526 Features[
"qsad-insts"] =
true;
527 Features[
"msad-insts"] =
true;
528 Features[
"mqsad-pk-insts"] =
true;
529 Features[
"mqsad-insts"] =
true;
530 Features[
"cvt-pknorm-vop2-insts"] =
true;
531 Features[
"fp8-conversion-insts"] =
true;
532 Features[
"wmma-128b-insts"] =
true;
533 Features[
"swmmac-gfx1200-insts"] =
true;
534 Features[
"atomic-fmin-fmax-global-f32"] =
true;
539 case GK_GFX11_7_GENERIC:
540 Features[
"ci-insts"] =
true;
541 Features[
"dot7-insts"] =
true;
542 Features[
"dot8-insts"] =
true;
543 Features[
"dot9-insts"] =
true;
544 Features[
"dot10-insts"] =
true;
545 Features[
"dot12-insts"] =
true;
546 Features[
"dl-insts"] =
true;
547 Features[
"16-bit-insts"] =
true;
548 Features[
"dpp"] =
true;
549 Features[
"gfx8-insts"] =
true;
550 Features[
"gfx9-insts"] =
true;
551 Features[
"flat-global-insts"] =
true;
552 Features[
"gfx10-insts"] =
true;
553 Features[
"gfx10-3-insts"] =
true;
554 Features[
"gfx11-insts"] =
true;
555 Features[
"atomic-fadd-rtn-insts"] =
true;
556 Features[
"image-insts"] =
true;
557 Features[
"cube-insts"] =
true;
558 Features[
"lerp-inst"] =
true;
559 Features[
"sad-insts"] =
true;
560 Features[
"qsad-insts"] =
true;
561 Features[
"msad-insts"] =
true;
562 Features[
"mqsad-pk-insts"] =
true;
563 Features[
"mqsad-insts"] =
true;
564 Features[
"cvt-pknorm-vop2-insts"] =
true;
565 Features[
"gws"] =
true;
566 Features[
"dot11-insts"] =
true;
567 Features[
"fp8-conversion-insts"] =
true;
568 Features[
"wmma-128b-insts"] =
true;
569 Features[
"swmmac-gfx1200-insts"] =
true;
570 Features[
"atomic-fmin-fmax-global-f32"] =
true;
581 case GK_GFX11_GENERIC:
582 Features[
"ci-insts"] =
true;
583 Features[
"dot5-insts"] =
true;
584 Features[
"dot7-insts"] =
true;
585 Features[
"dot8-insts"] =
true;
586 Features[
"dot9-insts"] =
true;
587 Features[
"dot10-insts"] =
true;
588 Features[
"dot12-insts"] =
true;
589 Features[
"dl-insts"] =
true;
590 Features[
"16-bit-insts"] =
true;
591 Features[
"dpp"] =
true;
592 Features[
"gfx8-insts"] =
true;
593 Features[
"gfx9-insts"] =
true;
594 Features[
"flat-global-insts"] =
true;
595 Features[
"gfx10-insts"] =
true;
596 Features[
"gfx10-3-insts"] =
true;
597 Features[
"gfx11-insts"] =
true;
598 Features[
"atomic-fadd-rtn-insts"] =
true;
599 Features[
"image-insts"] =
true;
600 Features[
"cube-insts"] =
true;
601 Features[
"lerp-inst"] =
true;
602 Features[
"sad-insts"] =
true;
603 Features[
"qsad-insts"] =
true;
604 Features[
"msad-insts"] =
true;
605 Features[
"mqsad-pk-insts"] =
true;
606 Features[
"mqsad-insts"] =
true;
607 Features[
"cvt-pknorm-vop2-insts"] =
true;
608 Features[
"gws"] =
true;
609 Features[
"wmma-256b-insts"] =
true;
610 Features[
"atomic-fmin-fmax-global-f32"] =
true;
619 case GK_GFX10_3_GENERIC:
620 Features[
"ci-insts"] =
true;
621 Features[
"dot1-insts"] =
true;
622 Features[
"dot2-insts"] =
true;
623 Features[
"dot5-insts"] =
true;
624 Features[
"dot6-insts"] =
true;
625 Features[
"dot7-insts"] =
true;
626 Features[
"dot10-insts"] =
true;
627 Features[
"dl-insts"] =
true;
628 Features[
"16-bit-insts"] =
true;
629 Features[
"dpp"] =
true;
630 Features[
"gfx8-insts"] =
true;
631 Features[
"gfx9-insts"] =
true;
632 Features[
"flat-global-insts"] =
true;
633 Features[
"gfx10-insts"] =
true;
634 Features[
"gfx10-3-insts"] =
true;
635 Features[
"image-insts"] =
true;
636 Features[
"s-memrealtime"] =
true;
637 Features[
"s-memtime-inst"] =
true;
638 Features[
"gws"] =
true;
639 Features[
"vmem-to-lds-load-insts"] =
true;
640 Features[
"atomic-fmin-fmax-global-f32"] =
true;
641 Features[
"atomic-fmin-fmax-global-f64"] =
true;
642 Features[
"cube-insts"] =
true;
643 Features[
"lerp-inst"] =
true;
644 Features[
"sad-insts"] =
true;
645 Features[
"qsad-insts"] =
true;
646 Features[
"msad-insts"] =
true;
647 Features[
"mqsad-pk-insts"] =
true;
648 Features[
"mqsad-insts"] =
true;
649 Features[
"cvt-pknorm-vop2-insts"] =
true;
653 Features[
"dot1-insts"] =
true;
654 Features[
"dot2-insts"] =
true;
655 Features[
"dot5-insts"] =
true;
656 Features[
"dot6-insts"] =
true;
657 Features[
"dot7-insts"] =
true;
658 Features[
"dot10-insts"] =
true;
662 case GK_GFX10_1_GENERIC:
663 Features[
"dl-insts"] =
true;
664 Features[
"ci-insts"] =
true;
665 Features[
"16-bit-insts"] =
true;
666 Features[
"dpp"] =
true;
667 Features[
"gfx8-insts"] =
true;
668 Features[
"gfx9-insts"] =
true;
669 Features[
"flat-global-insts"] =
true;
670 Features[
"gfx10-insts"] =
true;
671 Features[
"image-insts"] =
true;
672 Features[
"s-memrealtime"] =
true;
673 Features[
"s-memtime-inst"] =
true;
674 Features[
"gws"] =
true;
675 Features[
"vmem-to-lds-load-insts"] =
true;
676 Features[
"atomic-fmin-fmax-global-f32"] =
true;
677 Features[
"atomic-fmin-fmax-global-f64"] =
true;
678 Features[
"cube-insts"] =
true;
679 Features[
"lerp-inst"] =
true;
680 Features[
"sad-insts"] =
true;
681 Features[
"qsad-insts"] =
true;
682 Features[
"msad-insts"] =
true;
683 Features[
"mqsad-pk-insts"] =
true;
684 Features[
"mqsad-insts"] =
true;
685 Features[
"cvt-pknorm-vop2-insts"] =
true;
688 Features[
"bitop3-insts"] =
true;
689 Features[
"fp6bf6-cvt-scale-insts"] =
true;
690 Features[
"fp4-cvt-scale-insts"] =
true;
691 Features[
"bf8-cvt-scale-insts"] =
true;
692 Features[
"fp8-cvt-scale-insts"] =
true;
693 Features[
"f16bf16-to-fp6bf6-cvt-scale-insts"] =
true;
694 Features[
"f32-to-f16bf16-cvt-sr-insts"] =
true;
695 Features[
"prng-inst"] =
true;
696 Features[
"permlane16-swap"] =
true;
697 Features[
"permlane32-swap"] =
true;
698 Features[
"ashr-pk-insts"] =
true;
699 Features[
"dot12-insts"] =
true;
700 Features[
"dot13-insts"] =
true;
701 Features[
"atomic-buffer-pk-add-bf16-inst"] =
true;
702 Features[
"gfx950-insts"] =
true;
705 Features[
"fp8-insts"] =
true;
706 Features[
"fp8-conversion-insts"] =
true;
707 if (Kind != GK_GFX950)
708 Features[
"xf32-insts"] =
true;
710 case GK_GFX9_4_GENERIC:
711 Features[
"gfx940-insts"] =
true;
712 Features[
"atomic-ds-pk-add-16-insts"] =
true;
713 Features[
"atomic-flat-pk-add-16-insts"] =
true;
714 Features[
"atomic-global-pk-add-bf16-inst"] =
true;
715 Features[
"gfx90a-insts"] =
true;
716 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
717 Features[
"atomic-fadd-rtn-insts"] =
true;
718 Features[
"dot3-insts"] =
true;
719 Features[
"dot4-insts"] =
true;
720 Features[
"dot5-insts"] =
true;
721 Features[
"dot6-insts"] =
true;
722 Features[
"mai-insts"] =
true;
723 Features[
"dl-insts"] =
true;
724 Features[
"dot1-insts"] =
true;
725 Features[
"dot2-insts"] =
true;
726 Features[
"dot7-insts"] =
true;
727 Features[
"dot10-insts"] =
true;
728 Features[
"gfx9-insts"] =
true;
729 Features[
"flat-global-insts"] =
true;
730 Features[
"gfx8-insts"] =
true;
731 Features[
"16-bit-insts"] =
true;
732 Features[
"dpp"] =
true;
733 Features[
"s-memrealtime"] =
true;
734 Features[
"ci-insts"] =
true;
735 Features[
"s-memtime-inst"] =
true;
736 Features[
"gws"] =
true;
737 Features[
"vmem-to-lds-load-insts"] =
true;
738 Features[
"atomic-fmin-fmax-global-f64"] =
true;
739 Features[
"wavefrontsize64"] =
true;
740 Features[
"cube-insts"] =
true;
741 Features[
"lerp-inst"] =
true;
742 Features[
"sad-insts"] =
true;
743 Features[
"qsad-insts"] =
true;
744 Features[
"msad-insts"] =
true;
745 Features[
"mqsad-pk-insts"] =
true;
746 Features[
"mqsad-insts"] =
true;
747 Features[
"cvt-pknorm-vop2-insts"] =
true;
750 Features[
"gfx90a-insts"] =
true;
751 Features[
"atomic-buffer-global-pk-add-f16-insts"] =
true;
752 Features[
"atomic-fadd-rtn-insts"] =
true;
753 Features[
"atomic-fmin-fmax-global-f64"] =
true;
756 Features[
"dot3-insts"] =
true;
757 Features[
"dot4-insts"] =
true;
758 Features[
"dot5-insts"] =
true;
759 Features[
"dot6-insts"] =
true;
760 Features[
"mai-insts"] =
true;
763 Features[
"dl-insts"] =
true;
764 Features[
"dot1-insts"] =
true;
765 Features[
"dot2-insts"] =
true;
766 Features[
"dot7-insts"] =
true;
767 Features[
"dot10-insts"] =
true;
774 case GK_GFX9_GENERIC:
775 Features[
"gfx9-insts"] =
true;
776 Features[
"flat-global-insts"] =
true;
777 Features[
"vmem-to-lds-load-insts"] =
true;
784 Features[
"gfx8-insts"] =
true;
785 Features[
"16-bit-insts"] =
true;
786 Features[
"dpp"] =
true;
787 Features[
"s-memrealtime"] =
true;
788 Features[
"ci-insts"] =
true;
789 Features[
"image-insts"] =
true;
790 Features[
"s-memtime-inst"] =
true;
791 Features[
"gws"] =
true;
792 Features[
"wavefrontsize64"] =
true;
793 Features[
"cube-insts"] =
true;
794 Features[
"lerp-inst"] =
true;
795 Features[
"sad-insts"] =
true;
796 Features[
"qsad-insts"] =
true;
797 Features[
"msad-insts"] =
true;
798 Features[
"mqsad-pk-insts"] =
true;
799 Features[
"mqsad-insts"] =
true;
800 Features[
"cvt-pknorm-vop2-insts"] =
true;
808 Features[
"ci-insts"] =
true;
809 Features[
"cube-insts"] =
true;
810 Features[
"lerp-inst"] =
true;
811 Features[
"sad-insts"] =
true;
812 Features[
"qsad-insts"] =
true;
813 Features[
"msad-insts"] =
true;
814 Features[
"mqsad-pk-insts"] =
true;
815 Features[
"mqsad-insts"] =
true;
816 Features[
"cvt-pknorm-vop2-insts"] =
true;
817 Features[
"image-insts"] =
true;
818 Features[
"s-memtime-inst"] =
true;
819 Features[
"gws"] =
true;
820 Features[
"atomic-fmin-fmax-global-f32"] =
true;
821 Features[
"atomic-fmin-fmax-global-f64"] =
true;
822 Features[
"wavefrontsize64"] =
true;
827 Features[
"image-insts"] =
true;
828 Features[
"s-memtime-inst"] =
true;
829 Features[
"gws"] =
true;
830 Features[
"atomic-fmin-fmax-global-f32"] =
true;
831 Features[
"atomic-fmin-fmax-global-f64"] =
true;
832 Features[
"wavefrontsize64"] =
true;
833 Features[
"cube-insts"] =
true;
834 Features[
"lerp-inst"] =
true;
835 Features[
"sad-insts"] =
true;
836 Features[
"msad-insts"] =
true;
837 Features[
"mqsad-pk-insts"] =
true;
838 Features[
"cvt-pknorm-vop2-insts"] =
true;
850std::pair<FeatureError, StringRef>
859 static const Triple AMDGCN(
"amdgcn-amd-amdhsa");
861 for (
auto &&GPU : GPUs) {
863 for (
auto &&[
F,
B] : Tmp)
866 Features[
"wavefrontsize32"] =
true;
867 Features[
"wavefrontsize64"] =
true;
868 }
else if (
T.isAMDGCN()) {
906 TargetTripleString(TT.normalize(
Triple::CanonicalForm::FOUR_IDENT)),
907 XnackSetting(XnackSetting), SramEccSetting(SramEccSetting),
908 IsAMDHSA(TT.getOS() ==
Triple::AMDHSA) {}
913 return TargetIDSetting::Off;
915 return TargetIDSetting::On;
924 for (
const auto &FeatureString : TargetIDSplit) {
925 if (FeatureString.starts_with(
"xnack"))
927 if (FeatureString.starts_with(
"sramecc"))
932std::optional<TargetID>
937 TargetIDDirective.
split(Parts,
'-', 4);
938 if (Parts.
size() < 4)
941 Triple TT(Parts[0], Parts[1], Parts[2], Parts[3]);
946 Parts[4].split(FeatureSplit,
':');
947 if (FeatureSplit.
empty())
964 ? TargetIDSetting::Any
965 : TargetIDSetting::Unsupported;
967 ? TargetIDSetting::Any
968 : TargetIDSetting::Unsupported;
972 if (FeatureString.starts_with(
"xnack"))
974 else if (FeatureString.starts_with(
"sramecc"))
978 return TargetID(Arch, TT, XnackSetting, SramEccSetting);
987 StreamRep <<
":sramecc-";
989 StreamRep <<
":sramecc+";
993 StreamRep <<
":xnack-";
995 StreamRep <<
":xnack+";
1007 return Arch ==
Other.Arch && XnackSetting ==
Other.XnackSetting &&
1008 SramEccSetting ==
Other.SramEccSetting && IsAMDHSA ==
Other.IsAMDHSA &&
1009 TargetTripleString ==
Other.TargetTripleString;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
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 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
TargetIDSetting getXnackSetting() const
void setTargetIDFromTargetIDStream(StringRef TargetID)
bool operator==(const TargetID &Other) const
TargetID(GPUKind Arch, const Triple &TT, TargetIDSetting XnackSetting, TargetIDSetting SramEccSetting)
std::string toString() const
TargetIDSetting getSramEccSetting() const
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...
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.