[DenseElementsAttr] Teach isValidRawBuffer that 1-elt values are splats.
authorChris Lattner <clattner@nondot.org>
Sat, 14 May 2022 10:48:17 +0000 (11:48 +0100)
committerChris Lattner <clattner@nondot.org>
Sat, 14 May 2022 10:49:43 +0000 (11:49 +0100)
commit5ac9d662093ddd880f9059f84b17296a882e7985
treea89f659bd3fe969b03a269a0adb87377571eb0a7
parentac7a9ef0ae3a5c63dc4e641f9912d8b659ebd720
[DenseElementsAttr] Teach isValidRawBuffer that 1-elt values are splats.

We want getRaw() on tensors with i1 element type with a zero or 1 value
to be treated as a splat.  This fixes:
https://github.com/llvm/llvm-project/issues/55440
mlir/lib/IR/BuiltinAttributes.cpp
mlir/test/Dialect/Tosa/canonicalize.mlir