Skip to content

Commit ca13437

Browse files
committed
[X86] Add a /tune: option for clang-cl
We recently added support for -mtune. This patch adds /tune: so we can specify the tune CPU from clang-cl. MSVC doesn't support this but icc does. Differential Revision: https://reviews.llvm.org/D86820
1 parent d9b4245 commit ca13437

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/include/clang/Driver/Options.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4696,6 +4696,9 @@ def _SLASH_openmp : CLFlag<"openmp">, HelpText<"Enable OpenMP support">,
46964696
def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">,
46974697
HelpText<"Enable OpenMP support with experimental SIMD support">,
46984698
Alias<fopenmp>;
4699+
def _SLASH_tune : CLCompileJoined<"tune:">,
4700+
HelpText<"Set CPU for optimization without affecting instruction set">,
4701+
Alias<mtune_EQ>;
46994702

47004703
// Non-aliases:
47014704

clang/test/Driver/cl-x86-flags.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,9 @@
128128
// RUN: %clang_cl -m64 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx51264 %s
129129
// avx51264: argument unused during compilation
130130

131+
// RUN: %clang_cl -m64 -arch:AVX -tune:haswell --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=tune %s
132+
// tune: "-target-cpu" "sandybridge"
133+
// tune-SAME: "-tune-cpu" "haswell"
134+
131135
void f() {
132136
}

0 commit comments

Comments
 (0)