Print result types when dumping graphviz.

PiperOrigin-RevId: 273406833
This commit is contained in:
Jing Pu 2019-10-07 16:45:26 -07:00 committed by A. Unique TensorFlower
parent 6b3462a77b
commit 17606a108b
1 changed files with 6 additions and 0 deletions

View 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.