Skip to content

Block Merging (MergeBlocks) #17

@avrabe

Description

@avrabe

Goal

Combine sequential basic blocks that have no other predecessors/successors.

Why High-Impact

  • 25-35% of code has mergeable blocks
  • Reduces CFG complexity (faster execution in interpreters)
  • Cleanup after DCE and branch removal
  • Improves cache locality

Tasks

  • Implement CFG construction
  • Identify blocks with single predecessor/successor
  • Merge block contents
  • Update branch targets
  • Add tests for block merging scenarios

Dependencies

Implementation Complexity

Medium

Priority

HIGH

Estimated Time

1-2 weeks (after control flow support)

References

  • wasm-opt: merge-blocks pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions