[PATCH] D119788: [AArch64] Add support for -march=native for Apple M1 CPU

Keith Smiley via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 18 16:06:04 PST 2022


keith added inline comments.


================
Comment at: llvm/lib/Support/Host.cpp:1326
+  case CPUFAMILY_ARM_CYCLONE:
+    return "apple-a7";
+  case CPUFAMILY_ARM_TYPHOON:
----------------
jrtc27 wrote:
> ARM only calls it cyclone, AArch64 allows both but apple-a7 is the canonical name (the comment above the cyclone alias states it's for old bitcode compatibility)
I saw this comment:

```
// Support cyclone as an alias for apple-a7 so we can still LTO old bitcode.
def : ProcessorModel<"cyclone", CycloneModel, ProcessorFeatures.AppleA7,
                     [TuneAppleA7]>;
```

And thought that implied that the `a7` name would be preferred to the "old" name for this case of case, wdyt?


================
Comment at: llvm/lib/Support/Host.cpp:1340
+  case CPUFAMILY_ARM_FIRESTORM_ICESTORM:
+    return "apple-m1";
+  default:
----------------
ab wrote:
> jrtc27 wrote:
> > Maybe a question for AArch64 maintainers about whether apple-a14 or apple-m1 should be used... they're the same thing from the backend's perspective just with different names. Shame the naming doesn't separate out the "generation" from the specific configuration like you see for other backends (apple-aN is almost that as it omits all the bionic etc marketing name fluff, except apple-m1 comes along and ruins that).
> Seems fine to stick to the `apple-aNN` names here.  (we already have a similar situation with `apple-sN`)
I felt like the `m1` name would be preferred here even though they're aliases just because I assume since this is for host CPUs you're more likely to hit this on an m1 machine than something that has an a14, which might lead to some user confusion. For example if you run `clang -march=native -###` with this change, you see `apple-m1` in the invocation, I would personally be surprised if I saw a14 there on my mac, even if they're the same.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119788



More information about the cfe-commits mailing list