From 76c84e702bd9af7db2bb9373ba6de0508f1e57a9 Mon Sep 17 00:00:00 2001 From: Shengchen Kan Date: Wed, 3 Jul 2024 16:02:58 +0800 Subject: [Driver][X86] Add flang visibility for -mapx-features= (#97525) The default visibility of `m_x86_Features_Group` is `ClangOption, CLOption`. For x86, we expose `-march` to flang but not `-m`. `apxf` is special b/c it contains several independent features like `egpr, ndd, ppx, push2pop2, ccmp, nf, cf` and `zu`. Users may would like to turn on part of features in different cases 1. enable `ndd` only when writing a code-size sensitive library 2. disable `ccmp`, `cf` when building component has strong security request on caches Hence, we expose `-mapx-features=` to flang for Fortran users. --- clang/include/clang/Driver/Options.td | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/include') diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 1c2b8cf..1ede75d 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -6319,9 +6319,9 @@ def mno_gather : Flag<["-"], "mno-gather">, Group, def mno_scatter : Flag<["-"], "mno-scatter">, Group, HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">; def mapx_features_EQ : CommaJoined<["-"], "mapx-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, - HelpText<"Disable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">; + HelpText<"Disable features of APX">, Values<"egpr,push2pop2,ppx,ndd,ccmp,nf,cf,zu">, Visibility<[ClangOption, CLOption, FlangOption]>; // For stability, we only add a feature to -mapxf after it passes the validation of llvm-test-suite && cpu2017 on Intel SDE. def mapxf : Flag<["-"], "mapxf">, Alias, AliasArgs<["egpr","push2pop2","ppx","ndd","ccmp","nf","cf"]>; def mno_apxf : Flag<["-"], "mno-apxf">, Alias, AliasArgs<["egpr","push2pop2","ppx","ndd","ccmp","nf","cf"]>; -- cgit v1.1