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

GTO: Remove minor optimization of avoiding ChildLocalizer sometimes #6818

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Aug 6, 2024

The optimization is to only use ChildLocalizer, which moves children to
locals, if we actually have a reason to use it. It is simple enough to see if
we are removing fields with side effects here, and only call ChildLocalizer
if we are not. However, this will become much more complicated in a
subsequent PR which will reorder fields, which allows removing yet more
of them (without reordering, we can only remove fields at the end, if any
subtype needs the field).

This is a pretty minor optimization, as it avoids adding a few locals in the rare
case of struct.new operands having side effects. We run --gto at the
start of the pipeline, so later opts will clean that up anyhow. (Though, this
might make us a little less efficient, but the following PR will justify this
regression.)

@kripken kripken requested a review from tlively August 6, 2024 23:44
@kripken
Copy link
Member Author

kripken commented Aug 7, 2024

I verified there is no difference at all in a large Java project with this change.

@kripken kripken merged commit dc87572 into WebAssembly:main Aug 7, 2024
13 checks passed
@kripken kripken deleted the gto.undo branch August 7, 2024 18:34
@gkdn gkdn mentioned this pull request Aug 31, 2024
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