[PATCH] D158046: [X86] Support -march=gracemont

Freddy, Ye via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 17 19:11:01 PDT 2023


FreddyYe added inline comments.


================
Comment at: clang/lib/Basic/Targets/X86.cpp:551
   case CK_Lunarlake:
+  case CK_Gracemont:
   case CK_Sierraforest:
----------------
RKSimon wrote:
> FreddyYe wrote:
> > RKSimon wrote:
> > > Why not handle this above (below tremont) as the next in the *mont series?
> > Good catch. This isn't a short story... In short words, it was to save codes in predefined-arch-macros.c.
> > If set gracemont as a series of atom processors, macros like `corei7`(predefined-arch-macros.c:2061-2062) won't be generated by `-march=gracemont`, and for history reasons, atom series processors defined some extra macros of their names, like "tremont", "goldmont", ... but these macros are not used any longer IIRC. So I decided to define gracemont as a non-atom series one.
> Hmm - how about we move it after Tremont and then add a comment explaining that going forward atom/e-cores will share p-core defines? 
> ```
> case CK_Tremont:
>     defineCPUMacros(Builder, "tremont");
>     break;
> case CK_Gracemont:
>   // Gracemont and later atom-cores use p-core cpu macros.
>   [[fallthrough]];
> case CK_Nehalem:
>  ...
> ```
Looks good! I refined a little bit and updated.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158046/new/

https://reviews.llvm.org/D158046



More information about the cfe-commits mailing list