This revision was automatically updated to reflect the committed changes.
Closed by commit rGca134374b74e: [X86] Add a /tune: option for clang-cl 
(authored by craig.topper).
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86820/new/

https://reviews.llvm.org/D86820

Files:
  clang/include/clang/Driver/Options.td
  clang/test/Driver/cl-x86-flags.c


Index: clang/test/Driver/cl-x86-flags.c
===================================================================
--- clang/test/Driver/cl-x86-flags.c
+++ clang/test/Driver/cl-x86-flags.c
@@ -128,5 +128,9 @@
 // RUN: %clang_cl -m64 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | 
FileCheck -check-prefix=avx51264 %s
 // avx51264: argument unused during compilation
 
+// RUN: %clang_cl -m64 -arch:AVX -tune:haswell --target=x86_64-pc-windows -### 
-- 2>&1 %s | FileCheck -check-prefix=tune %s
+// tune: "-target-cpu" "sandybridge"
+// tune-SAME: "-tune-cpu" "haswell"
+
 void f() {
 }
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -4696,6 +4696,9 @@
 def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">,
   HelpText<"Enable OpenMP support with experimental SIMD support">,
   Alias<fopenmp>;
+def _SLASH_tune : CLCompileJoined<"tune:">,
+  HelpText<"Set CPU for optimization without affecting instruction set">,
+  Alias<mtune_EQ>;
 
 // Non-aliases:
 


Index: clang/test/Driver/cl-x86-flags.c
===================================================================
--- clang/test/Driver/cl-x86-flags.c
+++ clang/test/Driver/cl-x86-flags.c
@@ -128,5 +128,9 @@
 // RUN: %clang_cl -m64 -arch:avx512 --target=i386-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=avx51264 %s
 // avx51264: argument unused during compilation
 
+// RUN: %clang_cl -m64 -arch:AVX -tune:haswell --target=x86_64-pc-windows -### -- 2>&1 %s | FileCheck -check-prefix=tune %s
+// tune: "-target-cpu" "sandybridge"
+// tune-SAME: "-tune-cpu" "haswell"
+
 void f() {
 }
Index: clang/include/clang/Driver/Options.td
===================================================================
--- clang/include/clang/Driver/Options.td
+++ clang/include/clang/Driver/Options.td
@@ -4696,6 +4696,9 @@
 def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">,
   HelpText<"Enable OpenMP support with experimental SIMD support">,
   Alias<fopenmp>;
+def _SLASH_tune : CLCompileJoined<"tune:">,
+  HelpText<"Set CPU for optimization without affecting instruction set">,
+  Alias<mtune_EQ>;
 
 // Non-aliases:
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to