[flang-commits] [flang] 6a21730 - [flang][OpenMP][NFC] Reduce FunctionFiltering pass boilerplate (#93951)
via flang-commits
flang-commits at lists.llvm.org
Mon Jun 3 02:16:14 PDT 2024
Author: Tom Eccles
Date: 2024-06-03T10:16:10+01:00
New Revision: 6a217307641972e27f9eee1adb80e649e10f229f
URL: https://github.com/llvm/llvm-project/commit/6a217307641972e27f9eee1adb80e649e10f229f
DIFF: https://github.com/llvm/llvm-project/commit/6a217307641972e27f9eee1adb80e649e10f229f.diff
LOG: [flang][OpenMP][NFC] Reduce FunctionFiltering pass boilerplate (#93951)
The pass constructor can be generated automatically.
This pass doesn't need to be adapted to support other top level
operations because it is specifically supposed to filter functions. We
don't need to filter non-function top level operations because without
use inside of functions they shouldn't lead to any codegen.
Added:
Modified:
flang/include/flang/Optimizer/Transforms/Passes.h
flang/include/flang/Optimizer/Transforms/Passes.td
flang/include/flang/Tools/CLOptions.inc
flang/lib/Optimizer/Transforms/OMPFunctionFiltering.cpp
Removed:
################################################################################
diff --git a/flang/include/flang/Optimizer/Transforms/Passes.h b/flang/include/flang/Optimizer/Transforms/Passes.h
index 46c38d107eec3..a7ba704fdb39b 100644
--- a/flang/include/flang/Optimizer/Transforms/Passes.h
+++ b/flang/include/flang/Optimizer/Transforms/Passes.h
@@ -53,6 +53,7 @@ namespace fir {
#define GEN_PASS_DECL_ADDALIASTAGS
#define GEN_PASS_DECL_OMPMAPINFOFINALIZATIONPASS
#define GEN_PASS_DECL_OMPMARKDECLARETARGETPASS
+#define GEN_PASS_DECL_OMPFUNCTIONFILTERING
#include "flang/Optimizer/Transforms/Passes.h.inc"
std::unique_ptr<mlir::Pass> createAffineDemotionPass();
@@ -72,8 +73,6 @@ std::unique_ptr<mlir::Pass> createAlgebraicSimplificationPass();
std::unique_ptr<mlir::Pass>
createAlgebraicSimplificationPass(const mlir::GreedyRewriteConfig &config);
-std::unique_ptr<mlir::Pass> createOMPFunctionFilteringPass();
-
std::unique_ptr<mlir::Pass> createVScaleAttrPass();
std::unique_ptr<mlir::Pass>
createVScaleAttrPass(std::pair<unsigned, unsigned> vscaleAttr);
diff --git a/flang/include/flang/Optimizer/Transforms/Passes.td b/flang/include/flang/Optimizer/Transforms/Passes.td
index f03412807d40a..82638200e5e20 100644
--- a/flang/include/flang/Optimizer/Transforms/Passes.td
+++ b/flang/include/flang/Optimizer/Transforms/Passes.td
@@ -343,7 +343,6 @@ def OMPMarkDeclareTargetPass
def OMPFunctionFiltering : Pass<"omp-function-filtering"> {
let summary = "Filters out functions intended for the host when compiling "
"for the target device.";
- let constructor = "::fir::createOMPFunctionFilteringPass()";
let dependentDialects = [
"mlir::func::FuncDialect",
"fir::FIROpsDialect"
diff --git a/flang/include/flang/Tools/CLOptions.inc b/flang/include/flang/Tools/CLOptions.inc
index e0141a3d76f0a..cca3344da02a1 100644
--- a/flang/include/flang/Tools/CLOptions.inc
+++ b/flang/include/flang/Tools/CLOptions.inc
@@ -349,7 +349,7 @@ inline void createOpenMPFIRPassPipeline(
pm, fir::createOMPMapInfoFinalizationPass);
pm.addPass(fir::createOMPMarkDeclareTargetPass());
if (isTargetDevice)
- pm.addPass(fir::createOMPFunctionFilteringPass());
+ pm.addPass(fir::createOMPFunctionFiltering());
}
#if !defined(FLANG_EXCLUDE_CODEGEN)
diff --git a/flang/lib/Optimizer/Transforms/OMPFunctionFiltering.cpp b/flang/lib/Optimizer/Transforms/OMPFunctionFiltering.cpp
index 005e84cb8e9f9..0c472246c2a44 100644
--- a/flang/lib/Optimizer/Transforms/OMPFunctionFiltering.cpp
+++ b/flang/lib/Optimizer/Transforms/OMPFunctionFiltering.cpp
@@ -103,7 +103,3 @@ class OMPFunctionFilteringPass
}
};
} // namespace
-
-std::unique_ptr<Pass> fir::createOMPFunctionFilteringPass() {
- return std::make_unique<OMPFunctionFilteringPass>();
-}
More information about the flang-commits
mailing list