[flang-commits] [flang] [Flang][OpenMP] NFC: Flang OpenMP passes cleanup (PR #107386)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Thu Sep 5 04:44:46 PDT 2024


https://github.com/skatrak created https://github.com/llvm/llvm-project/pull/107386

For consistency, this patch renames the `FunctionFiltering` pass to `FunctionFilteringPass`. Also, OpenMP pass-related `#define`s are removed from flang/Optimizer/Transforms/Passes.h, since `#define`s don't have an effect there after moving related passes to flang/Optimizer/OpenMP/Passes.td.

>From e6b650a3fa4d5abaa684a0fa2f25312f4d624849 Mon Sep 17 00:00:00 2001
From: Sergio Afonso <safonsof at amd.com>
Date: Thu, 5 Sep 2024 11:55:43 +0100
Subject: [PATCH] [Flang][OpenMP] NFC: Flang OpenMP passes cleanup

For consistency, this patch renames the `FunctionFiltering` pass to
`FunctionFilteringPass`. Also, OpenMP pass-related `#define`s are removed from
flang/Optimizer/Transforms/Passes.h, since `#define`s don't have an effect
there after moving related passes to flang/Optimizer/OpenMP/Passes.td.
---
 flang/include/flang/Optimizer/OpenMP/Passes.td    | 2 +-
 flang/include/flang/Optimizer/Transforms/Passes.h | 3 ---
 flang/include/flang/Tools/CLOptions.inc           | 2 +-
 flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp  | 4 ++--
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/flang/include/flang/Optimizer/OpenMP/Passes.td b/flang/include/flang/Optimizer/OpenMP/Passes.td
index a5f98e1320c940..1c0ce08f5b4838 100644
--- a/flang/include/flang/Optimizer/OpenMP/Passes.td
+++ b/flang/include/flang/Optimizer/OpenMP/Passes.td
@@ -28,7 +28,7 @@ def MarkDeclareTargetPass
   let dependentDialects = ["mlir::omp::OpenMPDialect"];
 }
 
-def FunctionFiltering : Pass<"omp-function-filtering"> {
+def FunctionFilteringPass : Pass<"omp-function-filtering"> {
   let summary = "Filters out functions intended for the host when compiling "
                 "for the target device.";
   let dependentDialects = [
diff --git a/flang/include/flang/Optimizer/Transforms/Passes.h b/flang/include/flang/Optimizer/Transforms/Passes.h
index 6f98e3a25ec125..59266a6adfe464 100644
--- a/flang/include/flang/Optimizer/Transforms/Passes.h
+++ b/flang/include/flang/Optimizer/Transforms/Passes.h
@@ -53,9 +53,6 @@ namespace fir {
 #define GEN_PASS_DECL_STACKRECLAIM
 #define GEN_PASS_DECL_LOOPVERSIONING
 #define GEN_PASS_DECL_ADDALIASTAGS
-#define GEN_PASS_DECL_OMPMAPINFOFINALIZATIONPASS
-#define GEN_PASS_DECL_OMPMARKDECLARETARGETPASS
-#define GEN_PASS_DECL_OMPFUNCTIONFILTERING
 #define GEN_PASS_DECL_VSCALEATTR
 #define GEN_PASS_DECL_FUNCTIONATTR
 #define GEN_PASS_DECL_CONSTANTARGUMENTGLOBALISATIONOPT
diff --git a/flang/include/flang/Tools/CLOptions.inc b/flang/include/flang/Tools/CLOptions.inc
index 20351dcf6d6f82..04b7f0ba370b86 100644
--- a/flang/include/flang/Tools/CLOptions.inc
+++ b/flang/include/flang/Tools/CLOptions.inc
@@ -370,7 +370,7 @@ inline void createOpenMPFIRPassPipeline(
   pm.addPass(flangomp::createMapInfoFinalizationPass());
   pm.addPass(flangomp::createMarkDeclareTargetPass());
   if (isTargetDevice)
-    pm.addPass(flangomp::createFunctionFiltering());
+    pm.addPass(flangomp::createFunctionFilteringPass());
 }
 
 #if !defined(FLANG_EXCLUDE_CODEGEN)
diff --git a/flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp b/flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp
index bd9005d3e2df6f..9554808824ac30 100644
--- a/flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp
+++ b/flang/lib/Optimizer/OpenMP/FunctionFiltering.cpp
@@ -22,7 +22,7 @@
 #include "llvm/ADT/SmallVector.h"
 
 namespace flangomp {
-#define GEN_PASS_DEF_FUNCTIONFILTERING
+#define GEN_PASS_DEF_FUNCTIONFILTERINGPASS
 #include "flang/Optimizer/OpenMP/Passes.h.inc"
 } // namespace flangomp
 
@@ -30,7 +30,7 @@ using namespace mlir;
 
 namespace {
 class FunctionFilteringPass
-    : public flangomp::impl::FunctionFilteringBase<FunctionFilteringPass> {
+    : public flangomp::impl::FunctionFilteringPassBase<FunctionFilteringPass> {
 public:
   FunctionFilteringPass() = default;
 



More information about the flang-commits mailing list