Skip to content

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

Merged
tlively merged 1 commit into
mainfrom
singleton-vec-join
Nov 2, 2023
Merged

[analysis] Allow joining a single vector element efficiently#6071
tlively merged 1 commit into
mainfrom
singleton-vec-join

Conversation

@tlively

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
MemberAuthor

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 commented Nov 2, 2023

Copy link
Copy Markdown
MemberAuthor

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
tlivelyforce-pushed the stack-lattice-fixups branch from 350ba10 to 838bfacCompareNovember 2, 2023 18:31
Base automatically changed from stack-lattice-fixups to mainNovember 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 merged commit 2c3860b into mainNov 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 freeto 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

@tlively@kripken