Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[analysis] Allow joining a single vector element efficiently #6071

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

tlively
Copy link
Member

@tlively tlively commented Nov 1, 2023

Previously, modifying a single vector element of a Shared<Vector> element
required materializing a full vector to do the join. When there is just a single
element to update, materializing all the other elements with bottom value is
useless work. Add a Vector<L>::SingletonElement utility that represents but
does not materialize a vector with a single non-bottom element and allow it to
be passed to Vector<L>::join. Also update Shared and Inverted so that
SingletonElement joins still work on vectors wrapped in those other lattices.

Element getTop() const noexcept
#if __cplusplus >= 202002L
requires FullLattice<L>
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't pulling its weight, complexity-wise, so I removed it as a drive-by.

@tlively tlively force-pushed the stack-lattice-fixups branch from 456aa3c to 350ba10 Compare November 2, 2023 17:02
@tlively tlively force-pushed the singleton-vec-join branch from b315131 to 8a7936d Compare November 2, 2023 17:02
@tlively
Copy link
Member Author

tlively commented Nov 2, 2023

Merge activity

  • Nov 2, 2:30 PM: @tlively started a stack merge that includes this pull request via Graphite.
  • Nov 2, 2:31 PM: Graphite rebased this pull request as part of a merge.
  • Nov 2, 2:32 PM: @tlively merged this pull request with Graphite.

@tlively tlively force-pushed the stack-lattice-fixups branch from 350ba10 to 838bfac Compare November 2, 2023 18:31
Base automatically changed from stack-lattice-fixups to main November 2, 2023 18:31
Previously, modifying a single vector element of a `Shared<Vector>` element
required materializing a full vector to do the join. When there is just a single
element to update, materializing all the other elements with bottom value is
useless work. Add a `Vector<L>::SingletonElement` utility that represents but
does not materialize a vector with a single non-bottom element and allow it to
be passed to `Vector<L>::join`. Also update `Shared` and `Inverted` so that
`SingletonElement` joins still work on vectors wrapped in those other lattices.
@tlively tlively force-pushed the singleton-vec-join branch from 8a7936d to ecd665e Compare November 2, 2023 18:31
@tlively tlively merged commit 2c3860b into main Nov 2, 2023
@tlively tlively deleted the singleton-vec-join branch November 2, 2023 18:32
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 2024
…mbly#6071)

Previously, modifying a single vector element of a `Shared<Vector>` element
required materializing a full vector to do the join. When there is just a single
element to update, materializing all the other elements with bottom value is
useless work. Add a `Vector<L>::SingletonElement` utility that represents but
does not materialize a vector with a single non-bottom element and allow it to
be passed to `Vector<L>::join`. Also update `Shared` and `Inverted` so that
`SingletonElement` joins still work on vectors wrapped in those other lattices.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants