Skip to content

Implement dead-assignment removal#531

Merged
LPTK merged 12 commits into
hkust-taco:hkmc2from
LPTK:dead-ass-rem
Jun 26, 2026
Merged

Implement dead-assignment removal#531
LPTK merged 12 commits into
hkust-taco:hkmc2from
LPTK:dead-ass-rem

Conversation

@LPTK

@LPTK LPTK commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This PR implements dead-assignment removal based on our existing intraprocedral data-flow analysis.

Implementing this uncovered several problems with the previous implementation, which were addressed, leading to other optimization improvements.


Codex was used to help diagnosed issues, but the code was mine.

Comment thread hkmc2/shared/src/test/mlscript/codegen/SwitchSpecialization.mls
@LPTK LPTK marked this pull request as ready for review June 25, 2026 10:28
@LPTK LPTK changed the title Implement dead assignment removal Implement dead-assignment removal Jun 25, 2026
@LPTK LPTK requested a review from AnsonYeung June 25, 2026 10:31
@LPTK LPTK added the optimizer label Jun 25, 2026

@AnsonYeung AnsonYeung left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks fine.

Comment thread hkmc2/shared/src/test/mlscript/codegen/SwitchSpecialization.mls
Comment thread hkmc2/shared/src/main/scala/hkmc2/codegen/BlockSimplifier.scala
Comment thread hkmc2/shared/src/main/scala/hkmc2/codegen/BlockSimplifier.scala Outdated
Comment thread hkmc2/shared/src/main/scala/hkmc2/codegen/BlockSimplifier.scala
@LPTK LPTK merged commit 6306b38 into hkust-taco:hkmc2 Jun 26, 2026
1 check passed
@LPTK LPTK deleted the dead-ass-rem branch June 26, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants