[flang-commits] [flang] [flang] Add the MLIR pass pipelines for dumping (PR #183144)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 4 01:05:12 PST 2026


================
@@ -133,6 +138,32 @@ inline void registerMLIRPassesForFortranTools() {
   mlir::registerLowerAffinePass();
 }
 
+/// Register the passes used in flang's MLIR pass pipeline so that
+/// --mlir-print-ir-before=<pass> and --mlir-print-ir-after=<pass> work.
+/// This must be called BEFORE mlir::registerPassManagerCLOptions() because
+/// that function creates the PassNameCLParser which snapshots the pass
+/// registry during initialization.
+inline void registerFlangPipelinePasses() {
----------------
jeanPerier wrote:

Maybe this file should be moved into the [flangPasses library](https://github.com/llvm/llvm-project/tree/e6425a764f039f29dfc4096567d64d529930d026/flang/lib/Optimizer/Passes) since it does not really have to do with helpers to support things around the IR, but helpers to use passes inside the drivers.

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


More information about the flang-commits mailing list