Print result types when dumping graphviz.
authorJing Pu <jingpu@google.com>
Mon, 7 Oct 2019 23:45:26 +0000 (16:45 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 7 Oct 2019 23:45:53 +0000 (16:45 -0700)
PiperOrigin-RevId: 273406833

mlir/lib/Transforms/ViewOpGraph.cpp

index 474b03a..8c4820e 100644 (file)
@@ -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<int> elideIfLarger(
@@ -69,6 +70,11 @@ std::string DOTGraphTraits<mlir::Block *>::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.