[DenseElementAttr] Simplify the public API for creating these.
authorChris Lattner <clattner@nondot.org>
Thu, 12 May 2022 04:32:16 +0000 (05:32 +0100)
committerChris Lattner <clattner@nondot.org>
Thu, 12 May 2022 15:18:23 +0000 (16:18 +0100)
commitf21896f2c6dc6f4c2c3d0f192f7fefd178f5d5f7
tree3eab38fe8ab458f342ec52ae10b788689d419939
parent6822ed035f188aa55f9ac283d2eb20dcc7a9ca07
[DenseElementAttr] Simplify the public API for creating these.

Instead of requiring the client to compute the "isSplat" bit,
compute it internally.  This makes the logic more consistent
and defines away a lot of "elements.size()==1" in the clients.

This addresses Issue #55185

Differential Revision: https://reviews.llvm.org/D125447
mlir/include/mlir/IR/BuiltinAttributes.h
mlir/include/mlir/IR/BuiltinAttributes.td
mlir/lib/CAPI/IR/BuiltinAttributes.cpp
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
mlir/lib/IR/BuiltinAttributes.cpp
mlir/lib/Parser/AttributeParser.cpp