[flang-commits] [flang] [Flang] Add opt-in affine loop optimization pipeline (PR #191854)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Apr 27 04:22:14 PDT 2026


================
@@ -202,6 +204,51 @@ void createDefaultFIROptimizerPassPipeline(mlir::PassManager &pm,
   config.setRegionSimplificationLevel(
       mlir::GreedySimplifyRegionLevel::Disabled);
   pm.addPass(mlir::createCSEPass());
+
+  // Affine loop optimization pipeline (opt-in via --enable-affine-loop-opt).
+  if (enableAffineLoopOpt) {
+    pm.addPass(mlir::createCanonicalizerPass(config));
+    pm.addPass(mlir::createCSEPass());
+
+    pm.addPass(mlir::createLoopInvariantCodeMotionPass());
----------------
tblah wrote:

Just curious here: what does the mlir LICM pass do that the FIR one doesn't?

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


More information about the flang-commits mailing list