Page MenuHomePhabricator

Sparse String Elements support.

Authored by rsuderman on Apr 24 2020, 5:24 PM.



Added support for sparse strings elements. This is a follow up from the original DenseStringElements.

Diff Detail

Event Timeline

rsuderman created this revision.Apr 24 2020, 5:24 PM
Herald added a project: Restricted Project. · View Herald Transcript

You also need to add a SparseElementsAttr::getZeroValue<StringRef> so that getValues<T> works:


Use cast here as it is guaranteed to be DenseIntOrFPElementsAttr, dyn_cast implies that it may return null.

rsuderman updated this revision to Diff 260048.Apr 24 2020, 6:20 PM

Added getZeroValue() for string.

rsuderman updated this revision to Diff 260049.Apr 24 2020, 6:21 PM
rsuderman marked an inline comment as done.

Inserted missing newline.

rriddle added inline comments.Apr 24 2020, 6:24 PM
1255 ↗(On Diff #260048)

You can just inline this in the getZeroValue<StringRef> below. The other methods are only defined like this because the values can't be constructed inline in the header file.

1282 ↗(On Diff #260048)

This needs to be a SFINAE template to avoid having ambiguous methods.

1283 ↗(On Diff #260048)

nit: Newline before here.

rsuderman updated this revision to Diff 260052.Apr 24 2020, 6:32 PM

Removed unneeded helper function.

rsuderman marked 3 inline comments as done.Apr 24 2020, 6:33 PM
rriddle accepted this revision.Apr 24 2020, 6:33 PM
This revision is now accepted and ready to land.Apr 24 2020, 6:33 PM
Harbormaster completed remote builds in B54658: Diff 260049.
This revision was automatically updated to reflect the committed changes.