This is an archive of the discontinued LLVM Phabricator instance.

[mlir][transform] change RaggedArray internals
ClosedPublic

Authored by ftynse on Mar 16 2023, 10:00 AM.

Details

Summary

Change the internal storage scheme from storing a MutableArrayRef to
storing an explicit offset+length pair. Storing an ArrayRef is dangerous
because it contains the pointer to the first element in the range, but
the entire storage vector may be reallocated, making the pointer
dangling. We don't know when the reallocation happends, so we can't
update the ArrayRefs. Store the explicit offset instead and construct
ArrayRefs on-the-fly.

Diff Detail

Event Timeline

ftynse created this revision.Mar 16 2023, 10:00 AM
ftynse requested review of this revision.Mar 16 2023, 10:00 AM
ftynse planned changes to this revision.Mar 16 2023, 10:00 AM
ftynse retitled this revision from [mlir][transform] WIP: change RaggedArray internals to [mlir][transform] change RaggedArray internals.Mar 16 2023, 10:17 AM
ftynse edited the summary of this revision. (Show Details)
Peiming accepted this revision.Mar 16 2023, 10:19 AM
This revision is now accepted and ready to land.Mar 16 2023, 10:19 AM
This revision was landed with ongoing or failed builds.Mar 16 2023, 4:14 PM
This revision was automatically updated to reflect the committed changes.