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

Polls in loops can create control flow invisible at the Flambda level #568

Open
lthls opened this issue Jul 17, 2021 · 1 comment
Open

Comments

@lthls
Copy link

lthls commented Jul 17, 2021

I'm creating an issue corresponding to ocaml#10520 in the upstream compiler.
Flambda would be allowed to do the same optimisations that Deadcode does, removing the initialisation step for mutable variables that are always assigned to before being read. If a poll is later inserted in the loop, this could introduce a path where the initialisation step becomes necessary again.

This is not a problem now, but will become one when we rebase on 4.13.

@mshinwell
Copy link

I talked to @stedolan about this. One reasonable solution might be to have a "maybe poll" operation in Flambda 2. This would be inserted at a superset of points where Polling might put the Ipoll instruction. Since Polling only inserts polls in a very small number of different kinds of places, this should be feasible.

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

No branches or pull requests

2 participants