[flang-commits] [flang] 8c19c24 - [flang][cuda][NFC] Add missing template declaration (#119443)

via flang-commits flang-commits at lists.llvm.org
Tue Dec 10 13:10:27 PST 2024


Author: Valentin Clement (バレンタイン クレメン)
Date: 2024-12-10T13:10:23-08:00
New Revision: 8c19c24a784739cde4930c9e809e6d95b7047555

URL: https://github.com/llvm/llvm-project/commit/8c19c24a784739cde4930c9e809e6d95b7047555
DIFF: https://github.com/llvm/llvm-project/commit/8c19c24a784739cde4930c9e809e6d95b7047555.diff

LOG: [flang][cuda][NFC] Add missing template declaration (#119443)

Added: 
    

Modified: 
    flang/lib/Optimizer/Passes/Pipelines.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Optimizer/Passes/Pipelines.cpp b/flang/lib/Optimizer/Passes/Pipelines.cpp
index e4f47398fa4e5d..72803aa3793cec 100644
--- a/flang/lib/Optimizer/Passes/Pipelines.cpp
+++ b/flang/lib/Optimizer/Passes/Pipelines.cpp
@@ -19,7 +19,8 @@ void addNestedPassToAllTopLevelOperations(mlir::PassManager &pm, F ctor) {
                      mlir::omp::PrivateClauseOp, fir::GlobalOp>(pm, ctor);
 }
 
-void addPassToGPUModuleOperations(mlir::PassManager &pm, PassConstructor ctor) {
+template <typename F>
+void addPassToGPUModuleOperations(mlir::PassManager &pm, F ctor) {
   mlir::OpPassManager &nestPM = pm.nest<mlir::gpu::GPUModuleOp>();
   nestPM.addNestedPass<mlir::func::FuncOp>(ctor());
   nestPM.addNestedPass<mlir::gpu::GPUFuncOp>(ctor());
@@ -274,7 +275,8 @@ void createDefaultFIRCodeGenPassPipeline(mlir::PassManager &pm,
   fir::addBoxedProcedurePass(pm);
   addNestedPassToAllTopLevelOperations<PassConstructor>(
       pm, fir::createAbstractResultOpt);
-  addPassToGPUModuleOperations(pm, fir::createAbstractResultOpt);
+  addPassToGPUModuleOperations<PassConstructor>(pm,
+                                                fir::createAbstractResultOpt);
   fir::addCodeGenRewritePass(
       pm, (config.DebugInfo != llvm::codegenoptions::NoDebugInfo));
   fir::addExternalNameConversionPass(pm, config.Underscoring);


        


More information about the flang-commits mailing list