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

via flang-commits flang-commits at lists.llvm.org
Tue Mar 3 19:03:04 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() {
----------------
tmjbios wrote:

Hmm. Moving it into InitFIR.cpp creates circular dependencies: it calls registration functions from FIRCodeGen, HLFIRTransforms, etc - all of which depend on FIRSupport. I'd need to create a new library just for this change. I agree it would be aesthetically pleasing to keep it the same as registerLLVMTranslation right below this, but it's proving to be a mess.

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


More information about the flang-commits mailing list