-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Goal
Remove unreachable branches, fold constant conditions, simplify control flow.
Why High-Impact
- 30-40% of code has simplifiable branches
- Guard patterns and error handling create many constant-folded branches
- Enables block merging and further DCE
- LOOM currently has NO control flow support - major gap
Tasks
- Implement constant condition folding for br_if
- Remove branches that are never taken
- Remove branches that are always taken (replace with unconditional br)
- Simplify branch tables with constant indices
- Remove unreachable code after unconditional branches
- Add tests for branch optimization scenarios
Dependencies
- Requires Control Flow Representation in ISLE #12 (Control Flow Representation)
Implementation Complexity
Medium-High
Priority
CRITICAL
Estimated Time
2-3 weeks (after control flow support)
References
- wasm-opt: remove-unused-brs pass
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request