-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Description
MLIR has a set of compiler command line flags to control printing IR for intermediate passes; a useful combination is (e.g.):
-mlir-print-ir-after-all: dumps IR after every pass-mlir-print-ir-tree-dir=out/: writes each pass output into a unique, numbers file, e.g. if the first 3 passes to run arepassA,passB,passA, the outputs areout/0_passA.mlir,out/1_passB.mlir,out/2_passA.mlir, etc. Specifying a directory makes it easy to dump outputs for e.g. an existingMakefilerule, without having to change the directory where the compiler binary runs; including the pass index solves the problem of collisions and also makes it easy for someone who is unfamiliar with the compilation pipeline to tell the ordering.
These two flags enable a helpful debugging workflow: dump everything, find an interesting symbol/type/label/etc in one pass, and then grep through all of the per-pass output to see the passes that introduce/remove it
I hacked something in my local branch of MPL to do something similar:
Would it make sense to clean these up and upstream them here?
Metadata
Metadata
Assignees
Labels
No labels