[PATCH] D134658: Fix -mcpu=native on non-macos Apple platforms

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 17:38:19 PDT 2022


jroelofs added inline comments.


================
Comment at: llvm/lib/Support/Host.cpp:1374
+    // Apple CPU to support that ISA.
+    return "apple-a12";
+#endif
----------------
keith wrote:
> jroelofs wrote:
> > keith wrote:
> > > I don't fully understand the comment here, should we not be defaulting to a newer chip like a13 / a14 instead? 
> > That comment explains why `apple-a12` is a better choice than `generic` when we know we're being built for an ABI that requires PAC: it is the earliest chip that supported those instructions.
> > 
> > If we were to put any later chip's name in here, then we could have incorrect codegen when we hit this case on A12 chips, as those arches have instructions that are not supported on A12.
> > 
> > Let me know if you think there's a clearer way to explain that in the comment.
> I guess my thought was that we shouldn't ever be able to hit this on an actual A12 or below CPU since all of those should be handled above?
Oh, I hadn't considered that! Good catch, I'll update the patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134658



More information about the llvm-commits mailing list