Skip to content

Comments

Optimization unreachable code elimination#42

Merged
sidrasali merged 10 commits intomainfrom
optimization-Unreachable-Code-Elimination
Sep 25, 2025
Merged

Optimization unreachable code elimination#42
sidrasali merged 10 commits intomainfrom
optimization-Unreachable-Code-Elimination

Conversation

@JoudiAlakkad
Copy link
Contributor

In this issue we added 2 further optimization, the unreachable code elimination and the copy propagation. Based on the book, we implemented transfer function, meet operator and the rewriting process at the end. Same with Unreachable code elimination, it was done in three passes, remove useless blocks, remove useless jumps and remove useless labels. At the end we deleted any resulting empty blocks. We added accordingly tests for both optimizations.
closes #41

@github-actions
Copy link

github-actions bot commented Sep 15, 2025

Code Coverage

File Coverage [65.29%]
src/jsMain/kotlin/optimizations/CopyPropagation.kt 35.56%
src/jsMain/kotlin/optimizations/Optimization.kt 100.00%
src/jsMain/kotlin/optimizations/UnreachableCodeElimination.kt 97.39%
src/jsMain/kotlin/tacky/Tacky.kt 47.22%
Total Project Coverage 83.22%

@sidrasali sidrasali merged commit 77f8199 into main Sep 25, 2025
2 checks passed
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.

Optimizations Part 2

2 participants