Skip to content

Ensure sound closure of local alloc regions in Lambda_to_flambda#516

Merged
mshinwell merged 2 commits intooxcaml:mainfrom
Keryan-dev:local-flambda2-tails
Feb 4, 2022
Merged

Ensure sound closure of local alloc regions in Lambda_to_flambda#516
mshinwell merged 2 commits intooxcaml:mainfrom
Keryan-dev:local-flambda2-tails

Conversation

@Keryan-dev
Copy link
Copy Markdown
Contributor

This uses continuations created through Lambda_to_flambda to track the expected state of local stack and close regions only when it's necessary, i.e. when jumping a continuation (through a function or not) outside the scope of relevant regions.

Wrapper continuations are used to avoid the duplications of End_region, which produces noisy additional Let_conts at some places that could be flatten out, but unused wrappers are cleared out by Closure_conversion so I don't expect a lot more code to be generated.

@mshinwell mshinwell added bug Something isn't working flambda2 Prerequisite for, or part of, flambda2 flambda2 beta labels Feb 4, 2022
@mshinwell mshinwell changed the title Ensure sound closure of region in Lambda_to_flambda Ensure sound closure of local alloc regions in Lambda_to_flambda Feb 4, 2022
Copy link
Copy Markdown
Contributor

@lthls lthls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the code is correct.
However, the approach used for placing regions (and in particular the various exceptional cases) needs to be documented.
@Keryan-dev is working on that, but I'm approving this PR already so that we can merge it now and spend all the time we want nitpicking on the documentation in a subsequent PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working flambda2 beta flambda2 Prerequisite for, or part of, flambda2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants