[PATCH] D157410: [Flang][Driver] Enable Rpass and other R family options.

2023-08-10 Thread Kiran Chandramohan via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6e13e3c3e5e2: [Flang][Driver] Enable Rpass and other R 
family options. (authored by Victor Kingi victor.ki...@arm.com, 
committed by kiranchandramohan).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157410

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  flang/test/Driver/driver-help-hidden.f90
  flang/test/Driver/driver-help.f90
  flang/test/Driver/frontend-forwarding.f90

Index: flang/test/Driver/frontend-forwarding.f90
===
--- flang/test/Driver/frontend-forwarding.f90
+++ flang/test/Driver/frontend-forwarding.f90
@@ -22,6 +22,13 @@
 ! RUN: -fppc-native-vector-element-order \
 ! RUN: -mllvm -print-before-all \
 ! RUN: -save-temps=obj \
+! RUN: -Rpass \
+! RUN: -Rpass-missed \
+! RUN: -Rpass-analysis \
+! RUN: -Rno-pass \
+! RUN: -Reverything \
+! RUN: -Rno-everything \
+! RUN: -Rpass=inline \
 ! RUN: -P \
 ! RUN:   | FileCheck %s
 
@@ -44,5 +51,12 @@
 ! CHECK: "-flang-experimental-hlfir"
 ! CHECK: "-fno-ppc-native-vector-element-order"
 ! CHECK: "-fppc-native-vector-element-order"
+! CHECK: "-Rpass"
+! CHECK: "-Rpass-missed"
+! CHECK: "-Rpass-analysis"
+! CHECK: "-Rno-pass"
+! CHECK: "-Reverything"
+! CHECK: "-Rno-everything"
+! CHECK: "-Rpass=inline"
 ! CHECK: "-mllvm" "-print-before-all"
 ! CHECK: "-save-temps=obj"
Index: flang/test/Driver/driver-help.f90
===
--- flang/test/Driver/driver-help.f90
+++ flang/test/Driver/driver-help.f90
@@ -91,6 +91,10 @@
 ! HELP-NEXT: -print-effective-triple Print the effective target triple
 ! HELP-NEXT: -print-target-triplePrint the normalized target triple
 ! HELP-NEXT: -P Disable linemarker output in -E mode
+! HELP-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -R  Enable the specified remark
 ! HELP-NEXT: -save-temps=Save intermediate compilation results.
 ! HELP-NEXT: -save-tempsSave intermediate compilation results
 ! HELP-NEXT: -std=   Language standard to compile for
@@ -214,6 +218,10 @@
 ! HELP-FC1-NEXT: -pic-level   Value for __PIC__
 ! HELP-FC1-NEXT: -plugin  Use the named plugin action instead of the default action (use "help" to list available options)
 ! HELP-FC1-NEXT: -P Disable linemarker output in -E mode
+! HELP-FC1-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -R  Enable the specified remark
 ! HELP-FC1-NEXT: -save-temps=Save intermediate compilation results.
 ! HELP-FC1-NEXT: -save-tempsSave intermediate compilation results
 ! HELP-FC1-NEXT: -std=   Language standard to compile for
Index: flang/test/Driver/driver-help-hidden.f90
===
--- flang/test/Driver/driver-help-hidden.f90
+++ flang/test/Driver/driver-help-hidden.f90
@@ -95,6 +95,10 @@
 ! CHECK-NEXT: -print-effective-triple Print the effective target triple
 ! CHECK-NEXT: -print-target-triplePrint the normalized target triple
 ! CHECK-NEXT: -P Disable linemarker output in -E mode
+! CHECK-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -R  Enable the specified remark
 ! CHECK-NEXT: -save-temps=Save intermediate compilation results.
 ! CHECK-NEXT: -save-tempsSave intermediate compilation results
 ! CHECK-NEXT: -std=   Language standard to compile for
Index: clang/lib/Driver/ToolChains/Flang.cpp
===
--- clang/lib/Driver/ToolChains/Flang.cpp
+++ 

[PATCH] D157410: [Flang][Driver] Enable Rpass and other R family options.

2023-08-10 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski accepted this revision.
awarzynski added a comment.

Thanks! LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157410

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


[PATCH] D157410: [Flang][Driver] Enable Rpass and other R family options.

2023-08-09 Thread victorkingi via Phabricator via cfe-commits
victorkingi updated this revision to Diff 548675.
victorkingi added a comment.

refactoring Options.td


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157410

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  flang/test/Driver/driver-help-hidden.f90
  flang/test/Driver/driver-help.f90
  flang/test/Driver/frontend-forwarding.f90

Index: flang/test/Driver/frontend-forwarding.f90
===
--- flang/test/Driver/frontend-forwarding.f90
+++ flang/test/Driver/frontend-forwarding.f90
@@ -22,6 +22,13 @@
 ! RUN: -fppc-native-vector-element-order \
 ! RUN: -mllvm -print-before-all \
 ! RUN: -save-temps=obj \
+! RUN: -Rpass \
+! RUN: -Rpass-missed \
+! RUN: -Rpass-analysis \
+! RUN: -Rno-pass \
+! RUN: -Reverything \
+! RUN: -Rno-everything \
+! RUN: -Rpass=inline \
 ! RUN: -P \
 ! RUN:   | FileCheck %s
 
@@ -44,5 +51,12 @@
 ! CHECK: "-flang-experimental-hlfir"
 ! CHECK: "-fno-ppc-native-vector-element-order"
 ! CHECK: "-fppc-native-vector-element-order"
+! CHECK: "-Rpass"
+! CHECK: "-Rpass-missed"
+! CHECK: "-Rpass-analysis"
+! CHECK: "-Rno-pass"
+! CHECK: "-Reverything"
+! CHECK: "-Rno-everything"
+! CHECK: "-Rpass=inline"
 ! CHECK: "-mllvm" "-print-before-all"
 ! CHECK: "-save-temps=obj"
Index: flang/test/Driver/driver-help.f90
===
--- flang/test/Driver/driver-help.f90
+++ flang/test/Driver/driver-help.f90
@@ -91,6 +91,10 @@
 ! HELP-NEXT: -print-effective-triple Print the effective target triple
 ! HELP-NEXT: -print-target-triplePrint the normalized target triple
 ! HELP-NEXT: -P Disable linemarker output in -E mode
+! HELP-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -R  Enable the specified remark
 ! HELP-NEXT: -save-temps=Save intermediate compilation results.
 ! HELP-NEXT: -save-tempsSave intermediate compilation results
 ! HELP-NEXT: -std=   Language standard to compile for
@@ -214,6 +218,10 @@
 ! HELP-FC1-NEXT: -pic-level   Value for __PIC__
 ! HELP-FC1-NEXT: -plugin  Use the named plugin action instead of the default action (use "help" to list available options)
 ! HELP-FC1-NEXT: -P Disable linemarker output in -E mode
+! HELP-FC1-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -R  Enable the specified remark
 ! HELP-FC1-NEXT: -save-temps=Save intermediate compilation results.
 ! HELP-FC1-NEXT: -save-tempsSave intermediate compilation results
 ! HELP-FC1-NEXT: -std=   Language standard to compile for
Index: flang/test/Driver/driver-help-hidden.f90
===
--- flang/test/Driver/driver-help-hidden.f90
+++ flang/test/Driver/driver-help-hidden.f90
@@ -95,6 +95,10 @@
 ! CHECK-NEXT: -print-effective-triple Print the effective target triple
 ! CHECK-NEXT: -print-target-triplePrint the normalized target triple
 ! CHECK-NEXT: -P Disable linemarker output in -E mode
+! CHECK-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -R  Enable the specified remark
 ! CHECK-NEXT: -save-temps=Save intermediate compilation results.
 ! CHECK-NEXT: -save-tempsSave intermediate compilation results
 ! CHECK-NEXT: -std=   Language standard to compile for
Index: clang/lib/Driver/ToolChains/Flang.cpp
===
--- clang/lib/Driver/ToolChains/Flang.cpp
+++ clang/lib/Driver/ToolChains/Flang.cpp
@@ -518,6 +518,9 @@
   // Add Codegen options
   addCodegenOptions(Args, CmdArgs);
 
+  // Add R Group options
+  

[PATCH] D157410: [Flang][Driver] Enable Rpass and other R family options.

2023-08-09 Thread Andrzej Warzynski via Phabricator via cfe-commits
awarzynski accepted this revision.
awarzynski added a comment.

LG, with a small suggestion :) (in the spirit of cleaning up Options.td)




Comment at: clang/include/clang/Driver/Options.td:819-831
+def Rpass_EQ : Joined<["-"], "Rpass=">, Group, 
Flags<[CC1Option, FlangOption, FC1Option]>,
   HelpText<"Report transformations performed by optimization passes whose "
"name matches the given POSIX regular expression">;
 def Rpass_missed_EQ : Joined<["-"], "Rpass-missed=">, Group,
-  Flags<[CC1Option]>,
+  Flags<[CC1Option, FlangOption, FC1Option]>,
   HelpText<"Report missed transformations by optimization passes whose "
"name matches the given POSIX regular expression">;

IIUC, these are the all options for optimisation remarks? I would extract them 
to a separate "block" and wrap like this:
```
//===--===//
// Optimisation remark options
//===--===//
let Flags = [CC1Option, FC1Option, FlangOption] in {

}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157410

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


[PATCH] D157410: [Flang][Driver] Enable Rpass and other R family options.

2023-08-09 Thread Kiran Chandramohan via Phabricator via cfe-commits
kiranchandramohan accepted this revision.
kiranchandramohan added a comment.

LG.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157410

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


[PATCH] D157410: [Flang][Driver] Enable Rpass and other R family options.

2023-08-09 Thread victorkingi via Phabricator via cfe-commits
victorkingi updated this revision to Diff 548530.
victorkingi added a comment.

Fix comment


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157410

Files:
  clang/include/clang/Driver/Options.td
  clang/lib/Driver/ToolChains/Flang.cpp
  flang/test/Driver/driver-help-hidden.f90
  flang/test/Driver/driver-help.f90
  flang/test/Driver/frontend-forwarding.f90

Index: flang/test/Driver/frontend-forwarding.f90
===
--- flang/test/Driver/frontend-forwarding.f90
+++ flang/test/Driver/frontend-forwarding.f90
@@ -22,6 +22,13 @@
 ! RUN: -fppc-native-vector-element-order \
 ! RUN: -mllvm -print-before-all \
 ! RUN: -save-temps=obj \
+! RUN: -Rpass \
+! RUN: -Rpass-missed \
+! RUN: -Rpass-analysis \
+! RUN: -Rno-pass \
+! RUN: -Reverything \
+! RUN: -Rno-everything \
+! RUN: -Rpass=inline \
 ! RUN: -P \
 ! RUN:   | FileCheck %s
 
@@ -44,5 +51,12 @@
 ! CHECK: "-flang-experimental-hlfir"
 ! CHECK: "-fno-ppc-native-vector-element-order"
 ! CHECK: "-fppc-native-vector-element-order"
+! CHECK: "-Rpass"
+! CHECK: "-Rpass-missed"
+! CHECK: "-Rpass-analysis"
+! CHECK: "-Rno-pass"
+! CHECK: "-Reverything"
+! CHECK: "-Rno-everything"
+! CHECK: "-Rpass=inline"
 ! CHECK: "-mllvm" "-print-before-all"
 ! CHECK: "-save-temps=obj"
Index: flang/test/Driver/driver-help.f90
===
--- flang/test/Driver/driver-help.f90
+++ flang/test/Driver/driver-help.f90
@@ -91,6 +91,10 @@
 ! HELP-NEXT: -print-effective-triple Print the effective target triple
 ! HELP-NEXT: -print-target-triplePrint the normalized target triple
 ! HELP-NEXT: -P Disable linemarker output in -E mode
+! HELP-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! HELP-NEXT: -R  Enable the specified remark
 ! HELP-NEXT: -save-temps=Save intermediate compilation results.
 ! HELP-NEXT: -save-tempsSave intermediate compilation results
 ! HELP-NEXT: -std=   Language standard to compile for
@@ -214,6 +218,10 @@
 ! HELP-FC1-NEXT: -pic-level   Value for __PIC__
 ! HELP-FC1-NEXT: -plugin  Use the named plugin action instead of the default action (use "help" to list available options)
 ! HELP-FC1-NEXT: -P Disable linemarker output in -E mode
+! HELP-FC1-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! HELP-FC1-NEXT: -R  Enable the specified remark
 ! HELP-FC1-NEXT: -save-temps=Save intermediate compilation results.
 ! HELP-FC1-NEXT: -save-tempsSave intermediate compilation results
 ! HELP-FC1-NEXT: -std=   Language standard to compile for
Index: flang/test/Driver/driver-help-hidden.f90
===
--- flang/test/Driver/driver-help-hidden.f90
+++ flang/test/Driver/driver-help-hidden.f90
@@ -95,6 +95,10 @@
 ! CHECK-NEXT: -print-effective-triple Print the effective target triple
 ! CHECK-NEXT: -print-target-triplePrint the normalized target triple
 ! CHECK-NEXT: -P Disable linemarker output in -E mode
+! CHECK-NEXT: -Rpass-analysis= Report transformation analysis from optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -Rpass-missed=   Report missed transformations by optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -Rpass=  Report transformations performed by optimization passes whose name matches the given POSIX regular expression
+! CHECK-NEXT: -R  Enable the specified remark
 ! CHECK-NEXT: -save-temps=Save intermediate compilation results.
 ! CHECK-NEXT: -save-tempsSave intermediate compilation results
 ! CHECK-NEXT: -std=   Language standard to compile for
Index: clang/lib/Driver/ToolChains/Flang.cpp
===
--- clang/lib/Driver/ToolChains/Flang.cpp
+++ clang/lib/Driver/ToolChains/Flang.cpp
@@ -518,6 +518,9 @@
   // Add Codegen options
   addCodegenOptions(Args, CmdArgs);
 
+  // Add R Group options
+  Args.AddAllArgs(CmdArgs,