This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Print the pass argument in parens for print-ir-before/after.
ClosedPublic

Authored by stellaraccident on Jul 12 2022, 4:18 PM.

Details

Reviewers
rriddle
Mogball
Summary

Example:

// -----// IR Dump Before LowerLinalgMicrokernels (iree-vmvx-lower-linalg-microkernels) //----- //

I've been meaning to suggest this for a long time, and I think the only reason we don't have it is because we didn't used to have the getArgument() handy when printing these comments. When debugging or putting a pipeline together based on such dumps, I often find myself grepping for the argument name of the pass (which is often related but not universally).

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript
stellaraccident requested review of this revision.Jul 12 2022, 4:18 PM
rriddle accepted this revision.Jul 12 2022, 4:20 PM
This revision is now accepted and ready to land.Jul 12 2022, 4:20 PM
rriddle added inline comments.Jul 12 2022, 4:20 PM
mlir/lib/Pass/IRPrinting.cpp
66

This looks unrelated.

mlir/lib/Pass/IRPrinting.cpp
66

clang-format is insisting.

mlir/lib/Pass/IRPrinting.cpp
66

(I can nfc this part separately while landing)

Mogball added inline comments.Jul 14 2022, 8:57 AM
mlir/lib/Pass/IRPrinting.cpp
161

Should this be omitted for passes without arguments?

Tests and additional cases.

Updated tests and got an additional case. PTAL.

mlir/lib/Pass/IRPrinting.cpp
161

I didn't know that was a thing... Can you give an example?

rriddle added inline comments.Jul 15 2022, 9:16 PM
mlir/lib/Pass/IRPrinting.cpp
161

We shouldn't ever worry about such a thing, it won't happen in any real cases that we care about.

Mogball accepted this revision.Jul 15 2022, 9:41 PM

Closed by https://reviews.llvm.org/rG1d6a90418e4bfc294b4174880e93cb43835ebdf5 (messed up the arcanist command and association was lost)