[flang] [clang] [flang][driver] Mark -fcommon and -mtune as visible in Flang (PR #68657)

2023-12-06 Thread Fangcao Wang via cfe-commits


@@ -5077,6 +5077,7 @@ def module_file_info : Flag<["-"], "module-file-info">, 
Flags<[NoXarchOption]>,
   HelpText<"Provide information about a particular module file">;
 def mthumb : Flag<["-"], "mthumb">, Group;
 def mtune_EQ : Joined<["-"], "mtune=">, Group,
+  Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption, 
FlangOption]>,

LittleMeepo wrote:

I made a mistake then and these options were not actually confirmed. Sorry, I 
will close the PR.

https://github.com/llvm/llvm-project/pull/68657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[flang] [clang] [flang][driver] Mark -fcommon and -mtune as visible in Flang (PR #68657)

2023-12-06 Thread Fangcao Wang via cfe-commits

https://github.com/LittleMeepo closed 
https://github.com/llvm/llvm-project/pull/68657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang][driver] Mark -fcommon and -mtune as visible in Flang (PR #68657)

2023-10-09 Thread Fangcao Wang via cfe-commits

https://github.com/LittleMeepo created 
https://github.com/llvm/llvm-project/pull/68657

None

>From 490145aaa74fc936682344162ba1340b65c2bebc Mon Sep 17 00:00:00 2001
From: wangfc 
Date: Tue, 10 Oct 2023 11:06:11 +0800
Subject: [PATCH] [flang][driver] Mark -fcommon and -mtune as visible in Flang

---
 clang/include/clang/Driver/Options.td |  3 ++-
 flang/test/Driver/misc-flags.f90  |  3 +++
 flang/test/Driver/tune-cpu.f90| 22 ++
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 flang/test/Driver/tune-cpu.f90

diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 5415b18d3f406df..8936df388d2db97 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1786,7 +1786,7 @@ def fno_record_command_line : Flag<["-"], 
"fno-record-command-line">,
 def : Flag<["-"], "frecord-gcc-switches">, Alias;
 def : Flag<["-"], "fno-record-gcc-switches">, Alias;
 def fcommon : Flag<["-"], "fcommon">, Group,
-  Visibility<[ClangOption, CLOption, CC1Option]>,
+  Visibility<[ClangOption, CLOption, CC1Option, FlangOption]>,
   HelpText<"Place uninitialized global variables in a common block">,
   MarshallingInfoNegativeFlag>,
   DocBrief<[{Place definitions of variables with no storage class and no 
initializer
@@ -5077,6 +5077,7 @@ def module_file_info : Flag<["-"], "module-file-info">, 
Flags<[NoXarchOption]>,
   HelpText<"Provide information about a particular module file">;
 def mthumb : Flag<["-"], "mthumb">, Group;
 def mtune_EQ : Joined<["-"], "mtune=">, Group,
+  Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption, 
FlangOption]>,
   HelpText<"Only supported on AArch64, PowerPC, RISC-V, SystemZ, and X86">;
 def multi__module : Flag<["-"], "multi_module">;
 def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
diff --git a/flang/test/Driver/misc-flags.f90 b/flang/test/Driver/misc-flags.f90
index 61d763c5b64dd21..9412ccb8347ff89 100644
--- a/flang/test/Driver/misc-flags.f90
+++ b/flang/test/Driver/misc-flags.f90
@@ -10,6 +10,9 @@
 ! Make sure that `-L' is "visible" to Flang's driver
 ! RUN: %flang -L/ -### %s
 
+! Make sure that `-fcommon' is "visible" to Flang's driver
+! RUN: %flang -fcommon -### %s
+
 program hello
   write(*,*), "Hello world!"
 end program hello
diff --git a/flang/test/Driver/tune-cpu.f90 b/flang/test/Driver/tune-cpu.f90
new file mode 100644
index 000..44af55e30ab4eb7
--- /dev/null
+++ b/flang/test/Driver/tune-cpu.f90
@@ -0,0 +1,22 @@
+! Test that -mtune is used and that the -tune-cpu is also added to the
+! clang command.
+
+! RUN: %flang --target=aarch64-linux-gnu -mtune=cortex-a57 -c %s -### 2>&1 \
+! RUN: | FileCheck %s -check-prefix=CHECK-A57
+
+! RUN: %flang --target=aarch64-linux-gnu -mtune=cortex-a76 -c %s -### 2>&1 \
+! RUN: | FileCheck %s -check-prefix=CHECK-A76
+
+! RUN: %flang --target=aarch64-linux-gnu -mtune=cortex-armv9 -c %s -### 2>&1 \
+! RUN: | FileCheck %s -check-prefix=CHECK-ARMV9
+
+! RUN: %flang --target=x86_64-linux-gnu -mtune=skylake -c %s -### 2>&1 \
+! RUN: | FileCheck %s -check-prefix=CHECK-SKYLAKE
+
+! CHECK-A57: "-tune-cpu" "cortex-a57"
+
+! CHECK-A76: "-tune-cpu" "cortex-a76"
+
+! CHECK-ARMV9: "-tune-cpu" "cortex-armv9"
+
+! CHECK-SKYLAKE: "-tune-cpu" "skylake"

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang][driver] Mark -fcommon and -mtune as visible in Flang (PR #68657)

2023-10-10 Thread Fangcao Wang via cfe-commits

https://github.com/LittleMeepo updated 
https://github.com/llvm/llvm-project/pull/68657

>From d056372043e9ee55caf4a7c8d1f708658986cfd1 Mon Sep 17 00:00:00 2001
From: wangfc 
Date: Tue, 10 Oct 2023 11:06:11 +0800
Subject: [PATCH] [flang][driver] Mark -fcommon and -mtune as visible in Flang

---
 clang/include/clang/Driver/Options.td| 3 ++-
 flang/test/Driver/driver-help-hidden.f90 | 1 +
 flang/test/Driver/driver-help.f90| 1 +
 flang/test/Driver/misc-flags.f90 | 3 +++
 4 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 5415b18d3f406df..8936df388d2db97 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1786,7 +1786,7 @@ def fno_record_command_line : Flag<["-"], 
"fno-record-command-line">,
 def : Flag<["-"], "frecord-gcc-switches">, Alias;
 def : Flag<["-"], "fno-record-gcc-switches">, Alias;
 def fcommon : Flag<["-"], "fcommon">, Group,
-  Visibility<[ClangOption, CLOption, CC1Option]>,
+  Visibility<[ClangOption, CLOption, CC1Option, FlangOption]>,
   HelpText<"Place uninitialized global variables in a common block">,
   MarshallingInfoNegativeFlag>,
   DocBrief<[{Place definitions of variables with no storage class and no 
initializer
@@ -5077,6 +5077,7 @@ def module_file_info : Flag<["-"], "module-file-info">, 
Flags<[NoXarchOption]>,
   HelpText<"Provide information about a particular module file">;
 def mthumb : Flag<["-"], "mthumb">, Group;
 def mtune_EQ : Joined<["-"], "mtune=">, Group,
+  Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption, 
FlangOption]>,
   HelpText<"Only supported on AArch64, PowerPC, RISC-V, SystemZ, and X86">;
 def multi__module : Flag<["-"], "multi_module">;
 def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
diff --git a/flang/test/Driver/driver-help-hidden.f90 
b/flang/test/Driver/driver-help-hidden.f90
index 807b0f938d27b5c..eddf7d0d59794a0 100644
--- a/flang/test/Driver/driver-help-hidden.f90
+++ b/flang/test/Driver/driver-help-hidden.f90
@@ -29,6 +29,7 @@
 ! CHECK-NEXT: -fapprox-func   Allow certain math function calls to be 
replaced with an approximately equivalent calculation
 ! CHECK-NEXT: -fbackslash Specify that backslash in string 
introduces an escape character
 ! CHECK-NEXT: -fcolor-diagnostics Enable colors in diagnostics
+! CHECK-NEXT: -fcommonPlace uninitialized global variables in 
a common block
 ! CHECK-NEXT: -fconvert=   Set endian conversion of data for 
unformatted files
 ! CHECK-NEXT: -fdefault-double-8  Set the default double precision kind to 
an 8 byte wide type
 ! CHECK-NEXT: -fdefault-integer-8 Set the default integer and logical kind 
to an 8 byte wide type
diff --git a/flang/test/Driver/driver-help.f90 
b/flang/test/Driver/driver-help.f90
index 4894f90f5310439..5c3273d825600a0 100644
--- a/flang/test/Driver/driver-help.f90
+++ b/flang/test/Driver/driver-help.f90
@@ -25,6 +25,7 @@
 ! HELP-NEXT: -fapprox-func   Allow certain math function calls to be 
replaced with an approximately equivalent calculation
 ! HELP-NEXT: -fbackslash Specify that backslash in string 
introduces an escape character
 ! HELP-NEXT: -fcolor-diagnostics Enable colors in diagnostics
+! HELP-NEXT: -fcommonPlace uninitialized global variables in a 
common block
 ! HELP-NEXT: -fconvert=   Set endian conversion of data for 
unformatted files
 ! HELP-NEXT: -fdefault-double-8  Set the default double precision kind to 
an 8 byte wide type
 ! HELP-NEXT: -fdefault-integer-8 Set the default integer and logical kind 
to an 8 byte wide type
diff --git a/flang/test/Driver/misc-flags.f90 b/flang/test/Driver/misc-flags.f90
index 61d763c5b64dd21..9412ccb8347ff89 100644
--- a/flang/test/Driver/misc-flags.f90
+++ b/flang/test/Driver/misc-flags.f90
@@ -10,6 +10,9 @@
 ! Make sure that `-L' is "visible" to Flang's driver
 ! RUN: %flang -L/ -### %s
 
+! Make sure that `-fcommon' is "visible" to Flang's driver
+! RUN: %flang -fcommon -### %s
+
 program hello
   write(*,*), "Hello world!"
 end program hello

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang][driver] Mark -fcommon and -mtune as visible in Flang (PR #68657)

2023-10-10 Thread Fangcao Wang via cfe-commits

https://github.com/LittleMeepo updated 
https://github.com/llvm/llvm-project/pull/68657

>From b7de162c0cd91864b1637ec184457b825e8727bc Mon Sep 17 00:00:00 2001
From: wangfc 
Date: Tue, 10 Oct 2023 11:06:11 +0800
Subject: [PATCH] [flang][driver] Mark -fcommon and -mtune as visible in Flang

---
 clang/include/clang/Driver/Options.td| 3 ++-
 flang/test/Driver/driver-help-hidden.f90 | 2 ++
 flang/test/Driver/driver-help.f90| 2 ++
 flang/test/Driver/misc-flags.f90 | 3 +++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/clang/include/clang/Driver/Options.td 
b/clang/include/clang/Driver/Options.td
index 5415b18d3f406df..8936df388d2db97 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1786,7 +1786,7 @@ def fno_record_command_line : Flag<["-"], 
"fno-record-command-line">,
 def : Flag<["-"], "frecord-gcc-switches">, Alias;
 def : Flag<["-"], "fno-record-gcc-switches">, Alias;
 def fcommon : Flag<["-"], "fcommon">, Group,
-  Visibility<[ClangOption, CLOption, CC1Option]>,
+  Visibility<[ClangOption, CLOption, CC1Option, FlangOption]>,
   HelpText<"Place uninitialized global variables in a common block">,
   MarshallingInfoNegativeFlag>,
   DocBrief<[{Place definitions of variables with no storage class and no 
initializer
@@ -5077,6 +5077,7 @@ def module_file_info : Flag<["-"], "module-file-info">, 
Flags<[NoXarchOption]>,
   HelpText<"Provide information about a particular module file">;
 def mthumb : Flag<["-"], "mthumb">, Group;
 def mtune_EQ : Joined<["-"], "mtune=">, Group,
+  Flags<[TargetSpecific]>, Visibility<[ClangOption, CLOption, DXCOption, 
FlangOption]>,
   HelpText<"Only supported on AArch64, PowerPC, RISC-V, SystemZ, and X86">;
 def multi__module : Flag<["-"], "multi_module">;
 def multiply__defined__unused : Separate<["-"], "multiply_defined_unused">;
diff --git a/flang/test/Driver/driver-help-hidden.f90 
b/flang/test/Driver/driver-help-hidden.f90
index 807b0f938d27b5c..55eb03256aa33bc 100644
--- a/flang/test/Driver/driver-help-hidden.f90
+++ b/flang/test/Driver/driver-help-hidden.f90
@@ -29,6 +29,7 @@
 ! CHECK-NEXT: -fapprox-func   Allow certain math function calls to be 
replaced with an approximately equivalent calculation
 ! CHECK-NEXT: -fbackslash Specify that backslash in string 
introduces an escape character
 ! CHECK-NEXT: -fcolor-diagnostics Enable colors in diagnostics
+! CHECK-NEXT: -fcommonPlace uninitialized global variables in 
a common block
 ! CHECK-NEXT: -fconvert=   Set endian conversion of data for 
unformatted files
 ! CHECK-NEXT: -fdefault-double-8  Set the default double precision kind to 
an 8 byte wide type
 ! CHECK-NEXT: -fdefault-integer-8 Set the default integer and logical kind 
to an 8 byte wide type
@@ -112,6 +113,7 @@
 ! CHECK-NEXT: -module-dirPut MODULE files in 
 ! CHECK-NEXT: -msve-vector-bits=
 ! CHECK-NEXT:  Specify the size in bits of an SVE 
vector register. Defaults to the vector length agnostic value of "scalable". 
(AArch64 only)
+! CHECK-NEXT: -mtune=  Only supported on AArch64, PowerPC, 
RISC-V, SystemZ, and X86
 ! CHECK-NEXT: --no-offload-arch=
 ! CHECK-NEXT: Remove CUDA/HIP offloading device 
architecture (e.g. sm_35, gfx906) from the list of devices to compile for. 
'all' resets the list to its default value.
 ! CHECK-NEXT: -nocpp  Disable predefined and command line 
preprocessor macros
diff --git a/flang/test/Driver/driver-help.f90 
b/flang/test/Driver/driver-help.f90
index 4894f90f5310439..289bf3397250f2d 100644
--- a/flang/test/Driver/driver-help.f90
+++ b/flang/test/Driver/driver-help.f90
@@ -25,6 +25,7 @@
 ! HELP-NEXT: -fapprox-func   Allow certain math function calls to be 
replaced with an approximately equivalent calculation
 ! HELP-NEXT: -fbackslash Specify that backslash in string 
introduces an escape character
 ! HELP-NEXT: -fcolor-diagnostics Enable colors in diagnostics
+! HELP-NEXT: -fcommonPlace uninitialized global variables in a 
common block
 ! HELP-NEXT: -fconvert=   Set endian conversion of data for 
unformatted files
 ! HELP-NEXT: -fdefault-double-8  Set the default double precision kind to 
an 8 byte wide type
 ! HELP-NEXT: -fdefault-integer-8 Set the default integer and logical kind 
to an 8 byte wide type
@@ -100,6 +101,7 @@
 ! HELP-NEXT: -module-dirPut MODULE files in 
 ! HELP-NEXT: -msve-vector-bits=
 ! HELP-NEXT:  Specify the size in bits of an SVE 
vector register. Defaults to the vector length agnostic value of "scalable". 
(AArch64 only)
+! HELP-NEXT: -mtune=  Only supported on AArch64, PowerPC, 
RISC-V, SystemZ, and X86
 ! HELP-NEXT: --no-offload-arch=
 ! HELP-NEXT: Remove CUDA/HIP offloading device 
architecture (e.g. sm_35, gfx906) from the list of devices to compile for. 
'all' resets the 

[clang] [flang][driver] Mark -fcommon and -mtune as visible in Flang (PR #68657)

2023-10-10 Thread Fangcao Wang via cfe-commits

https://github.com/LittleMeepo edited 
https://github.com/llvm/llvm-project/pull/68657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [flang][driver] Mark -fcommon and -mtune as visible in Flang (PR #68657)

2023-10-16 Thread Fangcao Wang via cfe-commits


@@ -10,6 +10,9 @@
 ! Make sure that `-L' is "visible" to Flang's driver
 ! RUN: %flang -L/ -### %s
 
+! Make sure that `-fcommon' is "visible" to Flang's driver

LittleMeepo wrote:

So should I put the test for this option somewhere else, or should I still put 
it in this file?

https://github.com/llvm/llvm-project/pull/68657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits