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

Zero alloc: move checkmach pass before Comballoc and CSE #1786

Merged

Conversation

gretay-js
Copy link
Contributor

@gretay-js gretay-js commented Aug 30, 2023

As discussed in #1762, CSE and Comballoc interferes with zero_alloc check. Instead of fixing the backend CSE pass to correctly propagate debuginfo with assume_zero_alloc, this PR moves checkmach pass earlier. This is fine because CSE and Comballoc preserve "zero_alloc" property at function level. This may not remain true if we add other properties in the future, but it is true for all other properties we have considered so far (no indirect calls, no raise, is pure).

These passes do not change allocations but manipulate
debuginfo. Checking before it does not need to
adjust these passes for Debuginfo.assume_zero_alloc.

This should be reconsidered if add other properties to check, but so
far the properties we have considered can be checked before
comballoc (no indirect calls, no raise, no updates for dynamic
memory).
@gretay-js gretay-js requested a review from xclerc as a code owner August 30, 2023 17:52
@gretay-js gretay-js merged commit f4225da into ocaml-flambda:main Aug 30, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants