[PATCH] D86965: Do not emit "-tune-cpu generic" for PS4 platform
Douglas Yung via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 1 11:50:10 PDT 2020
dyung created this revision.
dyung added a reviewer: probinson.
dyung added a project: clang.
dyung requested review of this revision.
For the PS4, do not emit "-tune-cpu generic" since the platform only has 1 known CPU and we do not want to prevent optimizations by tuning for a generic rather than the specific processor it contains.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D86965
Files:
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/ps4-cpu-defaults.cpp
Index: clang/test/Driver/ps4-cpu-defaults.cpp
===================================================================
--- clang/test/Driver/ps4-cpu-defaults.cpp
+++ clang/test/Driver/ps4-cpu-defaults.cpp
@@ -1,6 +1,7 @@
// Check that on the PS4 we default to:
-// -target-cpu btver2 and no exceptions
+// -target-cpu btver2, no exceptions and not -tune-cpu generic
// RUN: %clang -target x86_64-scei-ps4 -c %s -### 2>&1 | FileCheck %s
// CHECK: "-target-cpu" "btver2"
// CHECK-NOT: exceptions
+// CHECK-NOT: "-tune-cpu" "generic"
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -2075,9 +2075,10 @@
// Handle -mtune.
- // Default to "generic" unless -march is present.
+ // Default to "generic" unless -march is present or targetting the PS4
std::string TuneCPU;
- if (!Args.hasArg(clang::driver::options::OPT_march_EQ))
+ if (!Args.hasArg(clang::driver::options::OPT_march_EQ) &&
+ !getToolChain().getTriple().isPS4CPU())
TuneCPU = "generic";
// Override based on -mtune.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86965.289239.patch
Type: text/x-patch
Size: 1155 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200901/7617b4b2/attachment.bin>
More information about the cfe-commits
mailing list