[mlir] Fix DenseElementsAttr treatment of bool splat of "true"
authorRiver Riddle <riddleriver@gmail.com>
Tue, 13 Sep 2022 01:42:08 +0000 (18:42 -0700)
committerRiver Riddle <riddleriver@gmail.com>
Tue, 13 Sep 2022 18:39:20 +0000 (11:39 -0700)
commit9e0900cbf1cbc2b8366df66a562bf031c8a2b8db
tree7eebc6c8dd96da19b0c414a6661f35f4419b5b22
parent34300ee3697e32926e998d1036925d0f59ffae02
[mlir] Fix DenseElementsAttr treatment of bool splat of "true"

Boolean splats currently can't roundtrip via the "raw" DenseElementsAttr
API. This is because internally we treat true splats in some cases as "1"(one bit set)
and in other cases as "0xFF"(all bits set). This commit cleans up this handling to
consistently use 0xFF (all bits set) as the value for a splat of true.

Differential Revision: https://reviews.llvm.org/D133743
mlir/lib/IR/AttributeDetail.h
mlir/unittests/IR/AttributeTest.cpp