Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions mlir/include/mlir/IR/Operation.h
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ class alignas(8) Operation final
void print(raw_ostream &os, AsmState &state);
void dump();

// Dump pretty printed IR. This method is helpful for better readability if
// the Operation is not verified because it won't disable custom printers to
// fall back to the generic one.
LLVM_DUMP_METHOD void dumpPretty();

//===--------------------------------------------------------------------===//
// Operands
//===--------------------------------------------------------------------===//
Expand Down
5 changes: 5 additions & 0 deletions mlir/lib/IR/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3985,6 +3985,11 @@ void Operation::dump() {
llvm::errs() << "\n";
}

void Operation::dumpPretty() {
print(llvm::errs(), OpPrintingFlags().useLocalScope().assumeVerified());
llvm::errs() << "\n";
}

void Block::print(raw_ostream &os) {
Operation *parentOp = getParentOp();
if (!parentOp) {
Expand Down
Loading