Skip to content

Commit 3348b46

Browse files
authored
[X86][compiler-rt] Split CPU names even they have the same subtype (#118237)
Fixes: #118205
1 parent 6f285d3 commit 3348b46

File tree

2 files changed

+54
-4
lines changed
  • compiler-rt/lib/builtins/cpu_model
  • llvm/lib/TargetParser

2 files changed

+54
-4
lines changed

compiler-rt/lib/builtins/cpu_model/x86.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,16 +461,31 @@ static const char *getIntelProcessorTypeAndSubtype(unsigned Family,
461461
// Alderlake:
462462
case 0x97:
463463
case 0x9a:
464+
CPU = "alderlake";
465+
*Type = INTEL_COREI7;
466+
*Subtype = INTEL_COREI7_ALDERLAKE;
467+
break;
468+
464469
// Raptorlake:
465470
case 0xb7:
466471
case 0xba:
467472
case 0xbf:
473+
CPU = "raptorlake";
474+
*Type = INTEL_COREI7;
475+
*Subtype = INTEL_COREI7_ALDERLAKE;
476+
break;
477+
468478
// Meteorlake:
469479
case 0xaa:
470480
case 0xac:
481+
CPU = "meteorlake";
482+
*Type = INTEL_COREI7;
483+
*Subtype = INTEL_COREI7_ALDERLAKE;
484+
break;
485+
471486
// Gracemont:
472487
case 0xbe:
473-
CPU = "alderlake";
488+
CPU = "gracement";
474489
*Type = INTEL_COREI7;
475490
*Subtype = INTEL_COREI7_ALDERLAKE;
476491
break;
@@ -486,9 +501,14 @@ static const char *getIntelProcessorTypeAndSubtype(unsigned Family,
486501

487502
// Arrowlake S:
488503
case 0xc6:
504+
CPU = "arrowlake-s";
505+
*Type = INTEL_COREI7;
506+
*Subtype = INTEL_COREI7_ARROWLAKE_S;
507+
break;
508+
489509
// Lunarlake:
490510
case 0xbd:
491-
CPU = "arrowlake-s";
511+
CPU = "lunarlake";
492512
*Type = INTEL_COREI7;
493513
*Subtype = INTEL_COREI7_ARROWLAKE_S;
494514
break;
@@ -510,6 +530,11 @@ static const char *getIntelProcessorTypeAndSubtype(unsigned Family,
510530

511531
// Emerald Rapids:
512532
case 0xcf:
533+
CPU = "emeraldrapids";
534+
*Type = INTEL_COREI7;
535+
*Subtype = INTEL_COREI7_SAPPHIRERAPIDS;
536+
break;
537+
513538
// Sapphire Rapids:
514539
case 0x8f:
515540
CPU = "sapphirerapids";

llvm/lib/TargetParser/Host.cpp

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,16 +808,31 @@ static StringRef getIntelProcessorTypeAndSubtype(unsigned Family,
808808
// Alderlake:
809809
case 0x97:
810810
case 0x9a:
811+
CPU = "alderlake";
812+
*Type = X86::INTEL_COREI7;
813+
*Subtype = X86::INTEL_COREI7_ALDERLAKE;
814+
break;
815+
811816
// Gracemont
812817
case 0xbe:
818+
CPU = "gracement";
819+
*Type = X86::INTEL_COREI7;
820+
*Subtype = X86::INTEL_COREI7_ALDERLAKE;
821+
break;
822+
813823
// Raptorlake:
814824
case 0xb7:
815825
case 0xba:
816826
case 0xbf:
827+
CPU = "raptorlake";
828+
*Type = X86::INTEL_COREI7;
829+
*Subtype = X86::INTEL_COREI7_ALDERLAKE;
830+
break;
831+
817832
// Meteorlake:
818833
case 0xaa:
819834
case 0xac:
820-
CPU = "alderlake";
835+
CPU = "meteorlake";
821836
*Type = X86::INTEL_COREI7;
822837
*Subtype = X86::INTEL_COREI7_ALDERLAKE;
823838
break;
@@ -833,9 +848,14 @@ static StringRef getIntelProcessorTypeAndSubtype(unsigned Family,
833848

834849
// Arrowlake S:
835850
case 0xc6:
851+
CPU = "arrowlake-s";
852+
*Type = X86::INTEL_COREI7;
853+
*Subtype = X86::INTEL_COREI7_ARROWLAKE_S;
854+
break;
855+
836856
// Lunarlake:
837857
case 0xbd:
838-
CPU = "arrowlake-s";
858+
CPU = "lunarlake";
839859
*Type = X86::INTEL_COREI7;
840860
*Subtype = X86::INTEL_COREI7_ARROWLAKE_S;
841861
break;
@@ -871,6 +891,11 @@ static StringRef getIntelProcessorTypeAndSubtype(unsigned Family,
871891

872892
// Emerald Rapids:
873893
case 0xcf:
894+
CPU = "emeraldrapids";
895+
*Type = X86::INTEL_COREI7;
896+
*Subtype = X86::INTEL_COREI7_SAPPHIRERAPIDS;
897+
break;
898+
874899
// Sapphire Rapids:
875900
case 0x8f:
876901
CPU = "sapphirerapids";

0 commit comments

Comments
 (0)