[flang-commits] [clang] [flang] [Driver][X86] Add flang visibility for -mapx-features= (PR #97525)

Shengchen Kan via flang-commits flang-commits at lists.llvm.org
Tue Jul 2 23:26:45 PDT 2024


https://github.com/KanRobert created https://github.com/llvm/llvm-project/pull/97525

None

>From 1aab0a95629371c61273c80f6335a6723c7d27c4 Mon Sep 17 00:00:00 2001
From: Shengchen Kan <shengchen.kan at intel.com>
Date: Wed, 3 Jul 2024 11:30:47 +0800
Subject: [PATCH] [Driver][X86] Add flang visibility for -mapx-features=

---
 clang/include/clang/Driver/Options.td     | 2 +-
 flang/test/Driver/target-cpu-features.f90 | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 1c2b8cfeef6ce..e1e6a6e3a0fcd 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -6319,7 +6319,7 @@ def mno_gather : Flag<["-"], "mno-gather">, Group<m_Group>,
 def mno_scatter : Flag<["-"], "mno-scatter">, Group<m_Group>,
                   HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">;
 def mapx_features_EQ : CommaJoined<["-"], "mapx-features=">, Group<m_x86_Features_Group>,
-    HelpText<"Enable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">;
+    HelpText<"Enable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">,  Visibility<[ClangOption, CLOption, FlangOption]>;
 def mno_apx_features_EQ : CommaJoined<["-"], "mno-apx-features=">, Group<m_x86_Features_Group>,
     HelpText<"Disable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">;
 // For stability, we only add a feature to -mapxf after it passes the validation of llvm-test-suite && cpu2017 on Intel SDE.
diff --git a/flang/test/Driver/target-cpu-features.f90 b/flang/test/Driver/target-cpu-features.f90
index e78c3516db45a..2728fb90afa41 100644
--- a/flang/test/Driver/target-cpu-features.f90
+++ b/flang/test/Driver/target-cpu-features.f90
@@ -17,6 +17,9 @@
 ! RUN: %flang --target=x86_64-linux-gnu -march=skylake -c %s -### 2>&1 \
 ! RUN: | FileCheck %s -check-prefix=CHECK-SKYLAKE
 
+! RUN: %flang --target=x86_64-linux-gnu -mapx-features=egpr -c %s -### 2>&1 \
+! RUN: | FileCheck %s -check-prefix=CHECK-APX
+
 ! RUN: %flang --target=x86_64h-linux-gnu -c %s -### 2>&1 \
 ! RUN: | FileCheck %s -check-prefix=CHECK-X86_64H
 
@@ -51,6 +54,9 @@
 ! CHECK-SKYLAKE: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
 ! CHECK-SKYLAKE-SAME: "-target-cpu" "skylake"
 
+! CHECK-APX: "-fc1" "-triple" "x86_64-unknown-linux-gnu"
+! CHECK-APX-SAME: "-target-feature" "+egpr"
+
 ! CHECK-X86_64H: "-fc1" "-triple" "x86_64h-unknown-linux-gnu"
 ! CHECK-X86_64H-SAME: "-target-cpu" "x86-64" "-target-feature" "-rdrnd" "-target-feature" "-aes" "-target-feature" "-pclmul" "-target-feature" "-rtm" "-target-feature" "-fsgsbase"
 



More information about the flang-commits mailing list