[Mlir-commits] [mlir] [MLIR][Python] Support Python-defined passes in MLIR (PR #156000)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Sep 1 06:28:46 PDT 2025


================
@@ -301,6 +301,10 @@ mlirFreezeRewritePattern(MlirRewritePatternSet op);
 MLIR_CAPI_EXPORTED void
 mlirFrozenRewritePatternSetDestroy(MlirFrozenRewritePatternSet op);
 
+MLIR_CAPI_EXPORTED MlirLogicalResult mlirApplyPatternsAndFoldGreedilyForOp(
+    MlirOperation op, MlirFrozenRewritePatternSet patterns,
+    MlirGreedyRewriteDriverConfig);
----------------
PragmaTwice wrote:

Hmmm, I perform a simple check on public repos via GitHub search (https://github.com/search?q=mlirApplyPatternsAndFoldGreedily+&type=code) and there seems to be some use cases of this API so I'm not sure if we should change it or not (maybe leave to maintainers for this decision : ).

Currently I'm going to rename it to `mlirApplyPatternsAndFoldGreedilyWithOp` to avoid such confusion with `ForOp` as you mentioned : )

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


More information about the Mlir-commits mailing list