Skip to content

Commit 4648803

Browse files
committed
Print result types in block arguments
1 parent da400cc commit 4648803

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mlir/lib/Transforms/ViewOpGraph.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,14 @@ class PrintOpPass : public impl::ViewOpGraphBase<PrintOpPass> {
355355

356356
/// Generate a label for a block argument.
357357
std::string getLabel(BlockArgument arg) {
358-
return "arg" + std::to_string(arg.getArgNumber());
358+
return strFromOs([&](raw_ostream &os) {
359+
os << "<" << getValuePortName(arg) << "> ";
360+
arg.printAsOperand(os, OpPrintingFlags());
361+
if (printResultTypes)
362+
os << " "
363+
<< truncateString(escapeLabelString(
364+
strFromOs([&](raw_ostream &os) { os << arg.getType(); })));
365+
});
359366
}
360367

361368
/// Process a block. Emit a cluster and one node per block argument and

0 commit comments

Comments
 (0)