Skip to content

Zero alloc: bounded join of witnesses#2489

Closed
gretay-js wants to merge 27 commits intooxcaml:mainfrom
gretay-js:zero_alloc_bounded_witnesses2
Closed

Zero alloc: bounded join of witnesses#2489
gretay-js wants to merge 27 commits intooxcaml:mainfrom
gretay-js:zero_alloc_bounded_witnesses2

Conversation

@gretay-js
Copy link
Copy Markdown
Contributor

On top of #2487. Last two commits are new.

Heuristics to limit the number of witnesses tracked by the analysis. This PR does not change precision of the analysis.

The first commit is the same as the first commit of #1472: keep at most n witnesses where n is based on -checkmach-details-cutoff n flag with default 20.

The second commit limits the number of elements of a symbolic representation of Join that contains Top. It can result in more or less witnesses depending on how the variables are resolved, but it is a reasonable limit based on n above and easy to compute.

Note that witnesses are not tracked by default for functions that are not annotated with [@zero_alloc ..] assertions (unless -checkmach-details-cutoff is set to track all witnesses, which is used for displaying allocations in an editor). The motivation of this PR is to ensure that adding an "assert" on a function does not increase compilation overhead unnecessarily.

@gretay-js gretay-js requested a review from xclerc April 24, 2024 16:44
@gretay-js gretay-js mentioned this pull request Apr 24, 2024
@mshinwell mshinwell added the zero alloc zero-alloc check label May 2, 2024
@gretay-js gretay-js force-pushed the zero_alloc_bounded_witnesses2 branch from 2ceda6e to 47b532c Compare May 2, 2024 12:07
@gretay-js
Copy link
Copy Markdown
Contributor Author

Included in #2524

@gretay-js gretay-js closed this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend zero alloc zero-alloc check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants