Skip to content

Commit 47b9ae6

Browse files
committed
Uniquely identify input and output ports.
Turns out we can use the same value in both input and result slots of an MLIR operation.
1 parent 76ab77f commit 47b9ae6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

mlir/lib/Transforms/ViewOpGraph.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,12 @@ class PrintOpPass : public impl::ViewOpGraphBase<PrintOpPass> {
248248
os << "v" << n1.id;
249249
if (!port.empty())
250250
// Attach edge to south compass point of the result
251-
os << ":" << port << ":s";
251+
os << ":res" << port << ":s";
252252
os << " -> ";
253253
os << "v" << n2.id;
254254
if (!port.empty())
255255
// Attach edge to north compass point of the operand
256-
os << ":" << port << ":n";
256+
os << ":arg" << port << ":n";
257257
emitAttrList(os, attrs);
258258
}));
259259
}
@@ -330,7 +330,7 @@ class PrintOpPass : public impl::ViewOpGraphBase<PrintOpPass> {
330330
if (op->getNumOperands() > 0) {
331331
os << "{";
332332
auto operandToPort = [&](Value operand) {
333-
os << "<" << getValuePortName(operand) << "> ";
333+
os << "<arg" << getValuePortName(operand) << "> ";
334334
emitMlirOperand(os, operand);
335335
};
336336
interleave(op->getOperands(), os, operandToPort, "|");
@@ -353,7 +353,7 @@ class PrintOpPass : public impl::ViewOpGraphBase<PrintOpPass> {
353353
if (op->getNumResults() > 0) {
354354
os << "|{";
355355
auto resultToPort = [&](Value result) {
356-
os << "<" << getValuePortName(result) << "> ";
356+
os << "<res" << getValuePortName(result) << "> ";
357357
emitMlirOperand(os, result);
358358
if (printResultTypes) {
359359
os << " ";
@@ -371,7 +371,7 @@ class PrintOpPass : public impl::ViewOpGraphBase<PrintOpPass> {
371371
/// Generate a label for a block argument.
372372
std::string getLabel(BlockArgument arg) {
373373
return strFromOs([&](raw_ostream &os) {
374-
os << "<" << getValuePortName(arg) << "> ";
374+
os << "<res" << getValuePortName(arg) << "> ";
375375
arg.printAsOperand(os, OpPrintingFlags());
376376
if (printResultTypes) {
377377
os << " ";

0 commit comments

Comments
 (0)