This patch adds a DenseI1ArrayAttr to support arrays of i1. Importantly,
the implementation is as a simple ArrayRef<bool> instead of using bit
compression, which was problematic in DenseElementsAttr.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/test/IR/attribute.mlir | ||
---|---|---|
545 | If the API is really about bool, those would be more natural than raw integers; e.g. given that this is what DenseElementsAttr/ArrayAttr/etc. are all doing. |
mlir/test/IR/attribute.mlir | ||
---|---|---|
545 | Would it make more sense for the syntax to be [:bool true, false, true]? |
mlir/test/IR/attribute.mlir | ||
---|---|---|
545 | Nah, for bool as a type we always use i1. It's only values where we use the more ergonomic "true"/"false". |
Change DenseI1ArrayAttr -> DenseBoolArrayAttr and change the values in the
assembly format to be true and false.
Also, you likely want to leave the bazel group to avoid getting hit on bazel failures (assuming you don't care about those anymore ;) )
I think someone has to remove me from the group :P I wasn't able to remove myself!
Also PTAL
For the resource version, we use DenseBoolResourceElementsAttr. We should try to keep these aligned.