Skip to content

Add dead code elimination#48

Merged
Zaneham merged 1 commit intoZaneham:masterfrom
nataliakokoromyti:add-dce
Feb 27, 2026
Merged

Add dead code elimination#48
Zaneham merged 1 commit intoZaneham:masterfrom
nataliakokoromyti:add-dce

Conversation

@nataliakokoromyti
Copy link
Copy Markdown
Contributor

DCE pass that runs after mem2reg. It builds use counts for every instruction, then kills anything with zero uses that has no side effects. Removing one dead instruction can make its operands dead too, so it loops until nothing changes. After that it compacts the instruction array and closes gaps between functions. Disabled with --no-dce.

@Zaneham Zaneham merged commit 6f1c11f into Zaneham:master Feb 27, 2026
3 checks passed
@Zaneham
Copy link
Copy Markdown
Owner

Zaneham commented Feb 27, 2026

Some nice work here. Good job getting this done! Checked and everything looking alright I'll do some tests on my end but Im happy to merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants