[PATCH] D92165: Don't elide splat attributes during printing
Tamas Berghammer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 27 04:18:02 PST 2020
tberghammer updated this revision to Diff 308017.
tberghammer marked an inline comment as done.
tberghammer added a comment.
Improve readability based on review commens
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92165/new/
https://reviews.llvm.org/D92165
Files:
mlir/lib/IR/AsmPrinter.cpp
mlir/test/IR/pretty-attributes.mlir
Index: mlir/test/IR/pretty-attributes.mlir
===================================================================
--- mlir/test/IR/pretty-attributes.mlir
+++ mlir/test/IR/pretty-attributes.mlir
@@ -16,3 +16,6 @@
// CHECK: opaque<"", "0xDEADBEEF"> : tensor<100xf32>
"test.opaque_attr"() {foo.opaque_attr = opaque<"", "0xEBFE"> : tensor<100xf32> } : () -> ()
+
+// CHECK: dense<1> : tensor<3xi32>
+"test.dense_splat"() {foo.dense_attr = dense<1> : tensor<3xi32>} : () -> ()
Index: mlir/lib/IR/AsmPrinter.cpp
===================================================================
--- mlir/lib/IR/AsmPrinter.cpp
+++ mlir/lib/IR/AsmPrinter.cpp
@@ -158,7 +158,8 @@
/// Return if the given ElementsAttr should be elided.
bool OpPrintingFlags::shouldElideElementsAttr(ElementsAttr attr) const {
return elementsAttrElementLimit.hasValue() &&
- *elementsAttrElementLimit < int64_t(attr.getNumElements());
+ *elementsAttrElementLimit < int64_t(attr.getNumElements()) &&
+ !attr.isa<SplatElementsAttr>();
}
/// Return the size limit for printing large ElementsAttr.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92165.308017.patch
Type: text/x-patch
Size: 1085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201127/1c647bc0/attachment.bin>
More information about the llvm-commits
mailing list