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

Allow unboxing to detect and delete dead code #1676

Merged
merged 7 commits into from
May 28, 2024

Conversation

Gbury
Copy link
Contributor

@Gbury Gbury commented Aug 1, 2023

This PR contains two changes:

  • continuation extra params and args can now record that some apply conts are invalid, and should be thus turned into an Invalid when rewriting it (instead of adding params/args)
  • the unboxing pass makes use of that new feature to mark some apply_conts as invalid, when unboxing discovers that it is actually invalid, cc @lthls for why and how this happens. Previously, in such cases we would just generate poison values.

This improves on the example from #1578 , and flambda2 is now able to eliminate the dead code of the gadt pattern match after inlining.

@chambart should review to ensure that all of the invalids encountered during unboxing are indeed invalids and not poison situations (and a round of testing on opam packages before merging would be useful).

@Gbury Gbury added the flambda2 Prerequisite for, or part of, flambda2 label Aug 1, 2023
@mshinwell
Copy link
Collaborator

@chambart ping on review please

@Gbury
Copy link
Contributor Author

Gbury commented Jan 9, 2024

@chambart ping, ^^

@mshinwell
Copy link
Collaborator

@Ekdohibs will review

@Gbury Gbury force-pushed the invalid_after_unboxing branch from c4c1834 to bca77af Compare May 28, 2024 08:47
Copy link
Contributor

@chambart chambart left a comment

Choose a reason for hiding this comment

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

Seems good

@Ekdohibs Ekdohibs merged commit 1a58792 into ocaml-flambda:main May 28, 2024
16 checks passed
mshinwell added a commit that referenced this pull request Jun 13, 2024
mshinwell added a commit that referenced this pull request Jun 13, 2024
mshinwell added a commit that referenced this pull request Jun 13, 2024
Revert "Allow unboxing to detect and delete dead code (#1676)"

This reverts commit 1a58792.
TheNumbat pushed a commit that referenced this pull request Jun 21, 2024
Revert "Allow unboxing to detect and delete dead code (#1676)"

This reverts commit 1a58792.
Ekdohibs added a commit to Ekdohibs/flambda-backend that referenced this pull request Jun 24, 2024
Ekdohibs added a commit that referenced this pull request Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flambda2 Prerequisite for, or part of, flambda2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants