[flang-commits] [flang] [flang] de-duplicate AbstractResult pass (PR #88867)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Fri Apr 19 04:02:32 PDT 2024


================
@@ -304,9 +330,7 @@ inline void createDebugPasses(
 inline void createDefaultFIRCodeGenPassPipeline(
     mlir::PassManager &pm, MLIRToLLVMPassPipelineConfig config) {
   fir::addBoxedProcedurePass(pm);
-  pm.addNestedPass<mlir::func::FuncOp>(
-      fir::createAbstractResultOnFuncOptPass());
-  pm.addNestedPass<fir::GlobalOp>(fir::createAbstractResultOnGlobalOptPass());
+  addNestedPassToAllTopLevelOperations(pm, fir::createAbstractResultOptPass);
----------------
tblah wrote:

Ahh I had missunderstood the tablegen change I made. I thought it made it inherit mlir::Pass, but you are right it is `mlir::OperationPass<>`.

Thanks for explaining. I will see if I can create a nested pass pipeline inside the AbstractResultPass so that even when run on a module it behaves the same way as if you ran the old function and global passes. And I agree that the `canScheduleOn` should be removed if possible.

https://github.com/llvm/llvm-project/pull/88867


More information about the flang-commits mailing list