This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add value_begin/value_end methods to DenseElementsAttr
ClosedPublic

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.Jul 5 2021, 1:26 AM
This revision is now accepted and ready to land.Jul 5 2021, 1:26 AM
jpienaar accepted this revision.Sep 2 2021, 2:38 PM
This revision was landed with ongoing or failed builds.Sep 20 2021, 6:58 PM
This revision was automatically updated to reflect the committed changes.