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)) {
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)) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits