[Mlir-commits] [mlir] [mlir][Arith] Generalize and improve -int-range-optimizations (PR #94712)

Ivan Butygin llvmlistbot at llvm.org
Fri Jun 7 08:29:00 PDT 2024


================
@@ -185,25 +176,11 @@ struct IntRangeOptimizationsPass
     if (failed(solver.initializeAndRun(op)))
       return signalPassFailure();
 
-    DataFlowListener listener(solver);
-
-    RewritePatternSet patterns(ctx);
-    populateIntRangeOptimizationsPatterns(patterns, solver);
-
-    GreedyRewriteConfig config;
-    config.listener = &listener;
-
-    if (failed(applyPatternsAndFoldGreedily(op, std::move(patterns), config)))
-      signalPassFailure();
+    doRewrites(solver, ctx, op->getRegions());
   }
 };
 } // namespace
 
-void mlir::arith::populateIntRangeOptimizationsPatterns(
----------------
Hardcode84 wrote:

Downstream we have a pass which uses our custom analysis, derived from `IntegerRangeAnalysis` with those patterns, but I guess, we can just make `doRewrites` function public (I can do it later in separate PR).

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


More information about the Mlir-commits mailing list