This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Add `print-ir` pass for debugging purposes
ClosedPublic

Authored by frgossen on Feb 27 2023, 2:27 PM.

Details

Summary

Add pass to print the entire IR on the debug stream.
This is meant for debugging purposes to inspect the IR at a specific point in the pipeline.

Diff Detail

Event Timeline

frgossen created this revision.Feb 27 2023, 2:27 PM
frgossen requested review of this revision.Feb 27 2023, 2:27 PM
frgossen updated this revision to Diff 501116.Feb 28 2023, 6:29 AM

Fix Cmake file

frgossen updated this revision to Diff 501125.Feb 28 2023, 7:01 AM
frgossen edited the summary of this revision. (Show Details)

Rebase

Is it equivalent to mlir-print-ir-after=pass-name ? https://mlir.llvm.org/docs/PassManagement/#ir-printing

mlir-print-ir-after=pass-name is easy enough to use from the opt tools. However, I could not find an easy way to set that programmatically (or pass the flag through the tests)

pifon2a accepted this revision.Mar 1 2023, 11:19 AM
pifon2a added inline comments.
mlir/lib/Transforms/DumpIR.cpp
18 ↗(On Diff #501220)

PrintIR?

This revision is now accepted and ready to land.Mar 1 2023, 11:19 AM
frgossen updated this revision to Diff 501602.Mar 1 2023, 11:28 AM

Address comments

pifon2a accepted this revision.Mar 1 2023, 11:29 AM
pifon2a added inline comments.
mlir/lib/Transforms/CMakeLists.txt
7

nit: sort

frgossen updated this revision to Diff 501604.Mar 1 2023, 11:31 AM
frgossen marked an inline comment as done.
frgossen retitled this revision from [MLIR] Add `dump-ir` pass for debugging purposes to [MLIR] Add `print-ir` pass for debugging purposes.
frgossen edited the summary of this revision. (Show Details)

.

Harbormaster completed remote builds in B216790: Diff 501605.
This revision was landed with ongoing or failed builds.Mar 1 2023, 11:42 AM
This revision was automatically updated to reflect the committed changes.