[Mlir-commits] [mlir] [milr] [docs] add view-op-graph and dump-pass-pipeline as useful CLI options (PR #194419)

Jeremy Kun llvmlistbot at llvm.org
Mon Apr 27 10:51:55 PDT 2026


https://github.com/j2kun updated https://github.com/llvm/llvm-project/pull/194419

>From 7e5527a40898d63afc88ae66222f3598c34162ba Mon Sep 17 00:00:00 2001
From: Jeremy Kun <jkun at google.com>
Date: Mon, 27 Apr 2026 10:32:38 -0700
Subject: [PATCH 1/2] add view-op-graph and dump-pass-pipeline as useful CLI
 options

---
 mlir/docs/Tutorials/MlirOpt.md | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/mlir/docs/Tutorials/MlirOpt.md b/mlir/docs/Tutorials/MlirOpt.md
index 83d08078bce48..1dc7f7b6407c1 100644
--- a/mlir/docs/Tutorials/MlirOpt.md
+++ b/mlir/docs/Tutorials/MlirOpt.md
@@ -9,6 +9,8 @@ Prerequisites:
 - [Building MLIR from source](/getting_started/)
 - [MLIR Language Reference](/docs/LangRef/)
 
+## Table of contents
+
 [TOC]
 
 ## `mlir-opt` basics
@@ -277,6 +279,9 @@ For more general information on pass management, see [Pass Infrastructure](/docs
       for patterns applied with the greedy rewriter engine.
     - `"dialect-conversion"` only prints debug information
       for the dialect conversion framework.
+ - `--dump-pass-pipeline` dumps the pass pipeline that will be run to standard output.
+   This output can be directly passed to `--pass-pipeline` and is useful to
+   identify exactly which passes and options are executed.
  - `--emit-bytecode` emits MLIR in the bytecode format.
  - `--mlir-pass-statistics` print statistics about the passes run.
     These are generated via [pass statistics](/docs/PassManagement/#pass-statistics).
@@ -287,8 +292,10 @@ For more general information on pass management, see [Pass Infrastructure](/docs
       IRs to files in a directory tree, making them easier to inspect versus a
       large dump to the terminal.
  - `--mlir-timing` displays execution times of each pass.
+ - `--view-op-graph` runs a pass that generates a Graphviz DOT file representing
+   the module at the given step of a pipeline.
 
-## Further readering
+## Further reading
 
 - [List of passes](/docs/Passes/)
 - [List of dialects](/docs/Dialects/)

>From a9a26685bfe676ba628e4f4a173d15e1c06b0783 Mon Sep 17 00:00:00 2001
From: Jeremy Kun <jkun at google.com>
Date: Mon, 27 Apr 2026 10:51:42 -0700
Subject: [PATCH 2/2] restate --help and add --help-hidden

---
 mlir/docs/Tutorials/MlirOpt.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mlir/docs/Tutorials/MlirOpt.md b/mlir/docs/Tutorials/MlirOpt.md
index 1dc7f7b6407c1..c74f1716b6efb 100644
--- a/mlir/docs/Tutorials/MlirOpt.md
+++ b/mlir/docs/Tutorials/MlirOpt.md
@@ -271,6 +271,7 @@ For more general information on pass management, see [Pass Infrastructure](/docs
 
 ## Useful CLI flags
 
+- `--help` and `--help-hidden` show a list of flags.
 - `--debug` prints all debug information produced by `LLVM_DEBUG` calls.
 - `--debug-only="my-tag"` prints only the debug information produced by `LLVM_DEBUG`
   in files that have the macro `#define DEBUG_TYPE "my-tag"`.



More information about the Mlir-commits mailing list