diff options
author | Craig Topper <craig.topper@intel.com> | 2020-08-26 14:44:25 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2020-08-26 14:52:03 -0700 |
commit | 71f3169e1baeff262583b35ef88f8fb6df7be85e (patch) | |
tree | e78a175fb4a1294a7a4a939360e792299ec173d9 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 0c55889d809027136048a0d144209a2bc282e7fc (diff) | |
download | llvm-71f3169e1baeff262583b35ef88f8fb6df7be85e.zip llvm-71f3169e1baeff262583b35ef88f8fb6df7be85e.tar.gz llvm-71f3169e1baeff262583b35ef88f8fb6df7be85e.tar.bz2 |
[X86] Default to -mtune=generic unless -march is passed to the driver. Add TuneCPU to the AST serialization
This patch defaults to -mtune=generic unless -march is present. If -march is present we'll use the empty string unless its overridden by mtune. The back should use the target cpu if the tune-cpu isn't present.
It also adds AST serialization support to fix some tests that emit AST and parse it back. These tests diff the IR against the output from not going through AST. So if we don't serialize the tune CPU we fail the diff.
Differential Revision: https://reviews.llvm.org/D86488
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 0313ff4..89dce75 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3877,7 +3877,7 @@ std::string CompilerInvocation::getModuleHash() const { // Extend the signature with the target options. code = hash_combine(code, TargetOpts->Triple, TargetOpts->CPU, - TargetOpts->ABI); + TargetOpts->TuneCPU, TargetOpts->ABI); for (const auto &FeatureAsWritten : TargetOpts->FeaturesAsWritten) code = hash_combine(code, FeatureAsWritten); |