From 17606a108b9464da4f960e11b132c9e968f31adb Mon Sep 17 00:00:00 2001 From: Jing Pu Date: Mon, 7 Oct 2019 16:45:26 -0700 Subject: [PATCH] Print result types when dumping graphviz. PiperOrigin-RevId: 273406833 --- mlir/lib/Transforms/ViewOpGraph.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mlir/lib/Transforms/ViewOpGraph.cpp b/mlir/lib/Transforms/ViewOpGraph.cpp index 474b03a..8c4820e 100644 --- a/mlir/lib/Transforms/ViewOpGraph.cpp +++ b/mlir/lib/Transforms/ViewOpGraph.cpp @@ -20,6 +20,7 @@ #include "mlir/IR/Operation.h" #include "mlir/IR/StandardTypes.h" #include "mlir/Pass/Pass.h" +#include "mlir/Support/STLExtras.h" #include "llvm/Support/CommandLine.h" static llvm::cl::opt elideIfLarger( @@ -69,6 +70,11 @@ std::string DOTGraphTraits::getNodeLabel(mlir::Operation *op, std::string ostr; raw_string_ostream os(ostr); os << op->getName() << "\n"; + + // Print resultant types + mlir::interleaveComma(op->getResultTypes(), os); + os << "\n"; + for (auto attr : op->getAttrs()) { os << '\n' << attr.first << ": "; // Always emit splat attributes. -- 2.7.4