Skip to content

Allow unboxing to detect and delete dead code#1676

Merged
Ekdohibs merged 7 commits intooxcaml:mainfrom
Gbury:invalid_after_unboxing
May 28, 2024
Merged

Allow unboxing to detect and delete dead code#1676
Ekdohibs merged 7 commits intooxcaml:mainfrom
Gbury:invalid_after_unboxing

Conversation

@Gbury
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

@chambart ping on review please

@Gbury
Copy link
Copy Markdown
Contributor Author

Gbury commented Jan 9, 2024

@chambart ping, ^^

@mshinwell
Copy link
Copy Markdown
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
Copy Markdown
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 oxcaml:main May 28, 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
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