[MLIR] Provide a way to print ops in custom form on pass failure
authorUday Bondhugula <uday@polymagelabs.com>
Sat, 16 Apr 2022 03:54:20 +0000 (09:24 +0530)
committerUday Bondhugula <uday@polymagelabs.com>
Sun, 17 Apr 2022 14:40:40 +0000 (20:10 +0530)
commitdaabcf5f04bbd13ac53f76ca3cc43b0d1ef64f5a
tree269a2ac993f2bdb664e74478cdc5c4e430b7554d
parent34a68037ddb4dff972c5d8c599cf5edf08fadf6b
[MLIR] Provide a way to print ops in custom form on pass failure

The generic form of the op is too verbose and in some cases not
readable. On pass failure, ops have been so far printed in generic form
to provide a (stronger) guarantee that the IR print succeeds. However,
in a large number of pass failure cases, the IR is still valid and
the custom printers for the ops will succeed. In fact, readability is
highly desirable post pass failure. This revision provides an option to
print ops in their custom/pretty-printed form on IR failure -- this
option is unsafe and there is no guarantee it will succeed. It's
disabled by default and can be turned on only if needed.

Differential Revision: https://reviews.llvm.org/D123893
mlir/include/mlir/Pass/PassManager.h
mlir/lib/Pass/IRPrinting.cpp
mlir/lib/Pass/PassManagerOptions.cpp
mlir/test/Pass/ir-printing.mlir