[Mlir-commits] [llvm] [mlir] [mlir] Add mlir-opt-repl: interactive MLIR pass pipeline explorer and MCP server (PR #203796)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Sun Jun 14 15:05:07 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r origin/main...HEAD mlir/test/mlir-opt-repl/conftest.py mlir/test/mlir-opt-repl/test_cli_and_edge_cases.py mlir/test/mlir-opt-repl/test_mcp.py mlir/test/mlir-opt-repl/test_repl.py mlir/tools/mlir-opt-repl/src/mlir_opt_repl/__init__.py mlir/tools/mlir-opt-repl/src/mlir_opt_repl/__main__.py mlir/tools/mlir-opt-repl/src/mlir_opt_repl/diff.py mlir/tools/mlir-opt-repl/src/mlir_opt_repl/engine.py mlir/tools/mlir-opt-repl/src/mlir_opt_repl/mcp.py mlir/tools/mlir-opt-repl/src/mlir_opt_repl/render.py mlir/tools/mlir-opt-repl/src/mlir_opt_repl/repl.py
``````````
: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 darker here.
</summary>
``````````diff
--- tools/mlir-opt-repl/src/mlir_opt_repl/repl.py 2026-06-14 22:02:58.000000 +0000
+++ tools/mlir-opt-repl/src/mlir_opt_repl/repl.py 2026-06-14 22:04:34.313568 +0000
@@ -175,11 +175,12 @@
print(f" {BOLD}--{p['name']}{RESET}: {DIM}{p['description']}{RESET}")
if not all_passes:
print(f"{DIM}(no passes matched){RESET}")
elif cmd == "help":
- print(f"""
+ print(
+ f"""
{BOLD}Commands:{RESET}
{CYAN}load <file.mlir>{RESET} Load MLIR from a file
{CYAN}load -{RESET} Load MLIR from stdin (blank line to finish)
{CYAN}run <passes...>{RESET} Apply passes to current IR
{CYAN}ir{RESET} Show current IR
@@ -188,9 +189,10 @@
{CYAN}sbs [a b]{RESET} Side-by-side diff (last step, or between indices a and b)
{CYAN}rewind [N]{RESET} Undo last N steps (default 1)
{CYAN}reset{RESET} Clear all state
{CYAN}passes [filter]{RESET} List available passes
{CYAN}quit{RESET} Exit
-""")
+"""
+ )
else:
print(f"{RED}Unknown command: {cmd}. Type 'help' for usage.{RESET}")
``````````
</details>
https://github.com/llvm/llvm-project/pull/203796
More information about the Mlir-commits
mailing list