This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add BoolArrayAttr in Tablegen + Builder support
ClosedPublic

Authored by nicolasvasilache on May 17 2020, 12:29 PM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald Transcript

Note though that all these "array attributes" are much less efficient than DenseAttribute I believe.

mehdi_amini accepted this revision.May 17 2020, 4:39 PM
ftynse accepted this revision.May 18 2020, 5:29 AM
This revision was not accepted when it landed; it landed in state Needs Review.May 18 2020, 6:57 AM
This revision was automatically updated to reflect the committed changes.

Note though that all these "array attributes" are much less efficient than DenseAttribute I believe.

Extremely inefficient.

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.