feat: Add dead code elimination and improve optimization

Integrates dead code elimination (DCE) into the optimizer.
This phase removes expressions that have no side effects and are not the
result of the block.

Also includes several improvements to the existing optimization passes:
- DCE now correctly handles assignments to variables that are never used
  or captured.
- Explicitly tracks captured slots in the `SubstitutionMap` to prevent
  premature inlining.
- Introduces a `is_side_effect_free` helper function for more robust
  purity checks.
- Updates dependencies to include `insta` for snapshot testing.
This commit is contained in:
Michael Schimmel
2026-02-21 22:51:53 +01:00
parent b2e010e755
commit 1aa844db22
3 changed files with 150 additions and 11 deletions
+3
View File
@@ -9,3 +9,6 @@ eframe = "0.33.3"
clap = { version = "4.5", features = ["derive"] }
chrono = "0.4"
regex = "1.10"
[dev-dependencies]
insta = { version = "1.39", features = ["yaml"] }