Page MenuHomePhabricator

[mlir] Add value_begin/value_end methods to DenseElementsAttr
AcceptedPublic

Authored by rriddle on Jun 11 2021, 9:05 PM.

Details

Summary

Currently DenseElementsAttr only exposes the ability to get the full range of values for a given type T, but there are many situations where we just want the beginning/end iterator. This revision adds proper value_begin/value_end methods for all of the supported T types, and also cleans up a bit of the interface.

Diff Detail

Event Timeline

rriddle created this revision.Jun 11 2021, 9:05 PM
rriddle requested review of this revision.Jun 11 2021, 9:05 PM

Im missing the motivation a little bit: is this to reduce number of characters typed or what is the benefit?

Im missing the motivation a little bit: is this to reduce number of characters typed or what is the benefit?

It reduces the number of characters, and is also more performant. For example, if we don't need the full range, we can avoid computing the number of elements.

ftynse accepted this revision.Mon, Jul 5, 1:26 AM
This revision is now accepted and ready to land.Mon, Jul 5, 1:26 AM