aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2020-08-18 14:52:44 -0700
committerCraig Topper <craig.topper@intel.com>2020-08-18 15:13:19 -0700
commit4cbceb74bb5676d0181d4d0cab5194d90a42c2ec (patch)
treee285418c1cf5f30a805a652c48e54bab124f49e0 /clang/lib/Frontend/CompilerInvocation.cpp
parent2f0178585722ae289a71cfd81f9ca42235e3aefd (diff)
downloadllvm-4cbceb74bb5676d0181d4d0cab5194d90a42c2ec.zip
llvm-4cbceb74bb5676d0181d4d0cab5194d90a42c2ec.tar.gz
llvm-4cbceb74bb5676d0181d4d0cab5194d90a42c2ec.tar.bz2
[X86] Add basic support for -mtune command line option in clang
Building on the backend support from D85165. This parses the command line option in the driver, passes it on to CC1 and adds a function attribute. -Still need to support tune on the target attribute. -Need to use "generic" as the tuning by default. But need to change generic in the backend first. -Need to set tune if march is specified and mtune isn't. -May need to disable getHostCPUName's ability to guess CPU name from features when it doesn't have a family/model match for mtune=native. That's what gcc appears to do. Differential Revision: https://reviews.llvm.org/D85384
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 3b69eef..477959f 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3658,6 +3658,7 @@ static void ParseTargetArgs(TargetOptions &Opts, ArgList &Args,
Opts.EABIVersion = EABIVersion;
}
Opts.CPU = std::string(Args.getLastArgValue(OPT_target_cpu));
+ Opts.TuneCPU = std::string(Args.getLastArgValue(OPT_tune_cpu));
Opts.FPMath = std::string(Args.getLastArgValue(OPT_mfpmath));
Opts.FeaturesAsWritten = Args.getAllArgValues(OPT_target_feature);
Opts.LinkerVersion =