summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms
diff options
context:
space:
mode:
authorJing Pu <jingpu@google.com>2019-11-18 11:27:08 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-11-18 11:27:43 -0800
commit563b5910a8394373454c5009d98f1b4fe13f0f68 (patch)
treeb159d55fa8ba42fe8d7dc750c4bc5aa8e23f2a4d /mlir/lib/Transforms
parent062dd406b1efd00483961ab3a4e75543e47b4859 (diff)
downloadbcm5719-llvm-563b5910a8394373454c5009d98f1b4fe13f0f68.tar.gz
bcm5719-llvm-563b5910a8394373454c5009d98f1b4fe13f0f68.zip
Also elide large array attribute in OpGraph Dump
PiperOrigin-RevId: 281114034
Diffstat (limited to 'mlir/lib/Transforms')
-rw-r--r--mlir/lib/Transforms/ViewOpGraph.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/mlir/lib/Transforms/ViewOpGraph.cpp b/mlir/lib/Transforms/ViewOpGraph.cpp
index f080ccd77e9..503a82bf82b 100644
--- a/mlir/lib/Transforms/ViewOpGraph.cpp
+++ b/mlir/lib/Transforms/ViewOpGraph.cpp
@@ -96,6 +96,12 @@ std::string DOTGraphTraits<mlir::Block *>::getNodeLabel(mlir::Operation *op,
continue;
}
+ auto array = attr.second.dyn_cast<mlir::ArrayAttr>();
+ if (array && static_cast<int64_t>(array.size()) > elideIfLarger) {
+ os << "[...]";
+ continue;
+ }
+
// Print all other attributes.
attr.second.print(os);
}
OpenPOWER on IntegriCloud