[PATCH] D55775: [Driver] Don't override '-march' when using '-arch x86_64h'
Francis Visoiu Mistrih via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 17 11:32:41 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL349381: [Driver] Don't override '-march' when using '-arch x86_64h' (authored by thegameg, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D55775?vs=178486&id=178504#toc
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55775/new/
https://reviews.llvm.org/D55775
Files:
cfe/trunk/lib/Driver/ToolChains/Arch/X86.cpp
cfe/trunk/lib/Driver/ToolChains/Darwin.cpp
cfe/trunk/test/Driver/clang-translation.c
Index: cfe/trunk/test/Driver/clang-translation.c
===================================================================
--- cfe/trunk/test/Driver/clang-translation.c
+++ cfe/trunk/test/Driver/clang-translation.c
@@ -33,6 +33,11 @@
// AVX2: "-target-cpu"
// AVX2: "core-avx2"
+// RUN: %clang -target x86_64h-apple-darwin -march=skx -### %s -o /dev/null 2>&1 | \
+// RUN: FileCheck -check-prefix=X8664HSKX %s
+// X8664HSKX: "-target-cpu"
+// X8664HSKX: "skx"
+
// RUN: %clang -target i386-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \
// RUN: FileCheck -check-prefix=PENRYN %s
// RUN: %clang -target x86_64-apple-macosx10.12 -### -S %s -o %t.s 2>&1 | \
Index: cfe/trunk/lib/Driver/ToolChains/Darwin.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Darwin.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Darwin.cpp
@@ -2017,12 +2017,8 @@
else if (Name == "pentIIm3")
DAL->AddJoinedArg(nullptr, MArch, "pentium2");
- else if (Name == "x86_64")
+ else if (Name == "x86_64" || Name == "x86_64h")
DAL->AddFlagArg(nullptr, Opts.getOption(options::OPT_m64));
- else if (Name == "x86_64h") {
- DAL->AddFlagArg(nullptr, Opts.getOption(options::OPT_m64));
- DAL->AddJoinedArg(nullptr, MArch, "x86_64h");
- }
else if (Name == "arm")
DAL->AddJoinedArg(nullptr, MArch, "armv4t");
Index: cfe/trunk/lib/Driver/ToolChains/Arch/X86.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Arch/X86.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Arch/X86.cpp
@@ -23,12 +23,8 @@
const char *x86::getX86TargetCPU(const ArgList &Args,
const llvm::Triple &Triple) {
if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_march_EQ)) {
- if (StringRef(A->getValue()) != "native") {
- if (Triple.isOSDarwin() && Triple.getArchName() == "x86_64h")
- return "core-avx2";
-
+ if (StringRef(A->getValue()) != "native")
return A->getValue();
- }
// FIXME: Reject attempts to use -march=native unless the target matches
// the host.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55775.178504.patch
Type: text/x-patch
Size: 2142 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181217/8659defa/attachment-0001.bin>
More information about the cfe-commits
mailing list