[Mlir-commits] [mlir] [mlir][Pass] Add new FileTreeIRPrinterConfig (PR #67840)
Christopher Bate
llvmlistbot at llvm.org
Wed May 8 10:28:02 PDT 2024
================
@@ -381,6 +381,42 @@ class PassManager : public OpPassManager {
bool printAfterOnlyOnFailure = false, raw_ostream &out = llvm::errs(),
OpPrintingFlags opPrintingFlags = OpPrintingFlags());
+ /// Similar to `enableIRPrinting` above, except that instead of printing
+ /// the IR to a single output stream, the instrumentation will print the
+ /// output of each pass to a separate file. The files will be organized into a
+ /// directory tree rooted at `printTreeDir`. The directories mirror the
+ /// nesting structure of the IR. For example, if the IR is congruent to the
+ /// pass-pipeline "builtin.module(pass1,pass2,func.func(pass3,pass4)))", and
+ /// `printTreeDir=/tmp/pipeline_output`, then then the tree file tree created
+ /// will look like:
+ ///
+ /// ```
+ /// /tmp/pass_output
+ /// ├── builtin_module_the_symbol_name
+ /// │ ├── 0_pass1.mlir
+ /// │ ├── 1_pass2.mlir
+ /// │ ├── func_func_my_func_name
+ /// │ │ ├── 2_pass3.mlir
+ /// │ │ ├── 3_pass4.mlir
+ /// │ ├── func_func_my_other_func_name
+ /// │ │ ├── 4_pass3.mlir
+ /// │ │ ├── 5_pass4.mlir
----------------
christopherbate wrote:
Wouldn't the below two pipelines both produce the same file tree (and same file names) using your suggested naming?
1. `builtin.module(cse,cse,func.func(cse))`
2. `builtin.module(cse,func.func(cse),cse)`
https://github.com/llvm/llvm-project/pull/67840
More information about the Mlir-commits
mailing list