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

Compiler: exit loop early #1505

Merged
merged 3 commits into from
Nov 29, 2023
Merged

Compiler: exit loop early #1505

merged 3 commits into from
Nov 29, 2023

Conversation

hhugo
Copy link
Member

@hhugo hhugo commented Aug 7, 2023

initially based on #1333 and #1334, then rebased on #1496.

The current implementation exits a loop as soon as possible. The generated code would be better if we allowed part of the continuations to remains inside the for-loop.

@hhugo hhugo marked this pull request as draft September 28, 2023 13:15
@hhugo
Copy link
Member Author

hhugo commented Nov 23, 2023

Check ocaml-wasm/wasm_of_ocaml@f517bbc

@hhugo hhugo marked this pull request as ready for review November 24, 2023 09:48
@hhugo
Copy link
Member Author

hhugo commented Nov 24, 2023

@vouillon, I've cherry-picked your implementation from wasm_of_ocaml. Do you think the same heuristic is appropriate for jsoo ? In particular, the is_small part ?

@hhugo
Copy link
Member Author

hhugo commented Nov 28, 2023

We should probably try to not nest loop if unnecessary.

@hhugo hhugo force-pushed the exit-loop-early branch 4 times, most recently from 52936d8 to d502e2e Compare November 28, 2023 16:54
@hhugo hhugo merged commit 51277d1 into master Nov 29, 2023
15 checks passed
@hhugo hhugo deleted the exit-loop-early branch November 29, 2023 10:14
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.

1 participant