[Mlir-commits] [mlir] [MLIR][Python] Support Python-defined rewrite patterns (PR #162699)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Oct 9 22:03:59 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- mlir/include/mlir-c/Rewrite.h mlir/lib/Bindings/Python/Rewrite.cpp mlir/lib/CAPI/Transforms/Rewrite.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/Bindings/Python/Rewrite.cpp b/mlir/lib/Bindings/Python/Rewrite.cpp
index c93836075..d2938841a 100644
--- a/mlir/lib/Bindings/Python/Rewrite.cpp
+++ b/mlir/lib/Bindings/Python/Rewrite.cpp
@@ -250,7 +250,8 @@ void mlir::python::populateRewriteSubmodule(nb::module_ &m) {
               nb::sig("def replace_op(self, op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation")
                 ", values: list[" MAKE_MLIR_PYTHON_QUALNAME("ir.Value") "]) -> None")
               // clang-format on
-              nb::arg("op"), nb::arg("values"))
+              nb::arg("op"),
+              nb::arg("values"))
           .def("erase_op", &PyPatternRewriter::eraseOp, "Erase an operation.",
                // clang-format off
                 nb::sig("def erase_op(self, op: " MAKE_MLIR_PYTHON_QUALNAME("ir.Operation") ") -> None")

``````````

</details>


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


More information about the Mlir-commits mailing list