[Mlir-commits] [mlir] [mlir][Pass] Add new FileTreeIRPrinterConfig (PR #67840)
Mehdi Amini
llvmlistbot at llvm.org
Wed May 8 18:28:40 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
----------------
joker-eph wrote:
Aren't the numbers prefix here to disambiguate in my example?
(not the two different counters I mentioned.
https://github.com/llvm/llvm-project/pull/67840
More information about the Mlir-commits
mailing list