llvm / llvm/llvm-project

[MLIR] Passes applied by the transform dialect should respect --mlir-print-* command line options

Open
#171,063 1 comment 0 reactions 0 assignees View on GitHub
mlir
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Use of the `transform.apply_registered_pass` op in the Transform dialect does not currently print any IR regardless of the presence of `--mlir-print-{...}` command line options.

Context is I was using a transform sequence injected into my MLIR for quickly editing and testing a portion of an under-development compilation pipeline, and I was getting deeply confused when some but not all of my passes were printing their output.

I guess it's marginally unclear whether or not eg. 'after each pass' in the command line argument documentation should refer to top-level passes in the pipeline only or, as I'm suggesting here, 'literally any time a pass is executed by any means', but I feel that as the IR printing is intrinsically a fairly developer/debugging-oriented option, the more verbose interpretation should at least not be unpleasantly surprising to the user.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the transform.apply_registered_pass operation and the handling of the --mlir-print-* command-line options. Check how IR printing is triggered for passes invoked through other paths, then ensure this operation follows the documented printing behavior and add or update coverage for the reported case.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.