[PATCH] D118527: [X86] Promote default mtune from generic to sandybridge

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 28 20:17:25 PST 2022


pengfei created this revision.
pengfei added reviewers: craig.topper, spatel, erichkeane, RKSimon, andrew.w.kaylor.
pengfei requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

We use `x86-64` as default target-cpu for a long time. It may be obsolete
given the old devices are phasing out.

Especially when we have added `x86-64-vN` for more than one year, more
and more users are using `x86-64-v2` now.

Conservatively, I think we have to use `x86-64` by default for a while.
But I believe promoting default mtune to sandybridge will do more good
than bad.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118527

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/x86-mtune.c


Index: clang/test/Driver/x86-mtune.c
===================================================================
--- clang/test/Driver/x86-mtune.c
+++ clang/test/Driver/x86-mtune.c
@@ -3,7 +3,7 @@
 // Default mtune should be generic.
 // RUN: %clang -target x86_64-unknown-unknown -c -### %s 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=notune
-// notune: "-tune-cpu" "generic"
+// notune: "-tune-cpu" "sandybridge"
 
 // RUN: %clang -target x86_64-unknown-unknown -c -### %s -mtune=generic 2>&1 \
 // RUN:   | FileCheck %s -check-prefix=generic
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -2255,11 +2255,11 @@
 
   // Handle -mtune.
 
-  // Default to "generic" unless -march is present or targetting the PS4.
+  // Default to "sandybridge" unless -march is present or targetting the PS4.
   std::string TuneCPU;
   if (!Args.hasArg(clang::driver::options::OPT_march_EQ) &&
       !getToolChain().getTriple().isPS4CPU())
-    TuneCPU = "generic";
+    TuneCPU = "sandybridge";
 
   // Override based on -mtune.
   if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_mtune_EQ)) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118527.404223.patch
Type: text/x-patch
Size: 1241 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220129/f5491551/attachment.bin>


More information about the cfe-commits mailing list