diff --git a/mlir/lib/Transforms/ViewOpGraph.cpp b/mlir/lib/Transforms/ViewOpGraph.cpp index 8c4820e38096..f080ccd77e9c 100644 --- a/mlir/lib/Transforms/ViewOpGraph.cpp +++ b/mlir/lib/Transforms/ViewOpGraph.cpp @@ -71,6 +71,10 @@ std::string DOTGraphTraits::getNodeLabel(mlir::Operation *op, raw_string_ostream os(ostr); os << op->getName() << "\n"; + if (!op->getLoc().isa()) { + os << op->getLoc() << "\n"; + } + // Print resultant types mlir::interleaveComma(op->getResultTypes(), os); os << "\n";