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

OnceReduction: Optimize bodies of trivial "once" functions #6061

Merged
merged 33 commits into from
Oct 31, 2023
Merged

Conversation

kripken
Copy link
Member

@kripken kripken commented Oct 27, 2023

In particular, if the body just calls another "once" function, then we can
skip the early-exit logic (see details in the comment in the new code).

Followup/replacement of #6055

cc @gkdn

@gkdn
Copy link
Contributor

gkdn commented Oct 31, 2023

Logic LGTM, validating on my branch.

@gkdn
Copy link
Contributor

gkdn commented Oct 31, 2023

Logic LGTM, validating on my branch.

👍

@kripken
Copy link
Member Author

kripken commented Oct 31, 2023

Great, thanks for confirming @gkdn

Meanwhile this has been fuzzed to almost 1M iterations, so I'm fairly confident in it (though this pattern is quite hard to fuzz).

@kripken kripken merged commit fad0698 into main Oct 31, 2023
14 checks passed
@kripken kripken deleted the twice.moar branch October 31, 2023 15:30
kripken added a commit that referenced this pull request Oct 31, 2023
kripken added a commit that referenced this pull request Oct 31, 2023
This reverts commit 2a4c278.
kripken added a commit that referenced this pull request Oct 31, 2023
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 2024
…ly#6061)

In particular, if the body just calls another "once" function, then we can
skip the early-exit logic.
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 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.

3 participants