[PATCH] D80090: [mlir] Add BoolArrayAttr in Tablegen + Builder support

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 27 13:36:30 PDT 2020


rriddle added a comment.

In D80090#2058237 <https://reviews.llvm.org/D80090#2058237>, @rriddle wrote:

> In D80090#2040848 <https://reviews.llvm.org/D80090#2040848>, @mehdi_amini wrote:
>
> > Note though that all these "array attributes" are much less efficient than DenseAttribute I believe.
>
>
> Extremely inefficient.


It isn't as bad for BoolAttr because we already cache the true/false attribute values on context construction so lookup for those is "free". BoolArrayAttr is still worse in memory(because it needs to store 1 word per element as opposed to 1 bit) and execution time(needs to do more pointer chasing when checking elements. In general though ArrayAttr is much much worse than DenseElementsAttr when storing integer/float/complex/string data and should be discouraged.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80090/new/

https://reviews.llvm.org/D80090





More information about the llvm-commits mailing list