[PATCH] D69841: Target Ivy bridge on macOS Mojave and later

David Zarzycki via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 04:17:26 PST 2019


davezarzycki created this revision.
davezarzycki added a reviewer: bob.wilson.
davezarzycki added a project: clang.

Ivy Bridge is required by macOS 10.14 (Mojave) and later.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69841

Files:
  clang/lib/Driver/ToolChains/Arch/X86.cpp


Index: clang/lib/Driver/ToolChains/Arch/X86.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Arch/X86.cpp
+++ clang/lib/Driver/ToolChains/Arch/X86.cpp
@@ -73,12 +73,15 @@
   if (Triple.isOSDarwin()) {
     if (Triple.getArchName() == "x86_64h")
       return "core-avx2";
-    // macosx10.12 drops support for all pre-Penryn Macs.
-    // Simulators can still run on 10.11 though, like Xcode.
-    if (Triple.isMacOSX() && !Triple.isOSVersionLT(10, 12))
-      return "penryn";
     // The oldest x86_64 Macs have core2/Merom; the oldest x86 Macs have Yonah.
-    return Is64Bit ? "core2" : "yonah";
+    // The simulators (i.e. Darwin but not macOS) can still run on older Macs.
+    // macosx10.12 requires Penryn.
+    if (!Triple.isMacOSX() || Triple.isOSVersionLT(10, 12))
+      return Is64Bit ? "core2" : "yonah";
+    // macosx10.14 requires Ivy Bridge.
+    if (Triple.isOSVersionLT(10, 14))
+      return "penryn";
+    return "ivybridge";
   }
 
   // Set up default CPU name for PS4 compilers.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69841.227844.patch
Type: text/x-patch
Size: 1061 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191105/2f3f7748/attachment.bin>


More information about the cfe-commits mailing list