iree-org / iree-llvm-sandbox

A sandbox for quick iteration and experimentation on projects related to IREE, MLIR, and LLVM
Apache License 2.0
55 stars 31 forks source link

Can the harness produce intermediate compilation IRs in separate files? #93

Closed giuseros closed 2 years ago

giuseros commented 2 years ago

This stemmed from the discussion here: https://github.com/google/iree-llvm-sandbox/pull/83#discussion_r763689396

The idea is to optionally save each pass result in a separate file, mainly for ease of use. Also each file should contain (as a comment) the entire mlir-proto-opt command to reproduce the IR

ftynse commented 2 years ago

It should be easy to have a Transformation subclass that is parameterized by the filename at creation time and just prints the module to that file without transforming it. Then mimic the print_ir helper to inject such transformations in any existing pipeline if desired. This has the extra benefit of being able to add such a transformation at selected points instead of all-or-nothing behavior.

I am wary of adding this to the harness itself, similarly to (now not) having the three "print IR" flags, as it will likely lead to a behemothic configuration mechanism instead of a simple tool.

giuseros commented 2 years ago

I added this, closing this issue