Skip to content

Use BasicBlock::contents.index in DomTree - #9217

Open
tlively wants to merge 2 commits into
wto-passesfrom
domtree-block-indices
Open

tlively wants to merge 2 commits into
wto-passesfrom
domtree-block-indices

Conversation

@tlively

@tlively tlively commented Oct 6, 2026

Copy link
Copy Markdown
Member

Read each basic block's reverse-postorder index from contents.index in
DomTree instead of allocating and populating an
unordered_map<BasicBlock*, Index>, and skip self-loop backedges
immediately with predIndex >= index. Update OnceReduction and
test/example/domtree.cpp to initialize contents.index, and remove the
redundant index initialization loop in WeakTopologicalOrdering.

Benchmark results across 16 WebAssembly modules (3 iterations,
interleaved):

  • --constraint-analysis:
    • Geomean: 1.646s -> 1.576s (-4.3%)
    • Total time: 64.83s -> 62.82s (-3.1%)
  • --rse:
    • Geomean: 0.922s -> 0.859s (-6.8%)
    • Total time: 27.09s -> 25.40s (-6.3%)

Read each basic block's reverse-postorder index from contents.index in
DomTree instead of allocating and populating an
unordered_map<BasicBlock*, Index>, and skip self-loop backedges
immediately with predIndex >= index. Update OnceReduction and
test/example/domtree.cpp to initialize contents.index, and remove the
redundant index initialization loop in WeakTopologicalOrdering.

Benchmark results across 16 WebAssembly modules (3 iterations,
interleaved):
- --constraint-analysis:
  - Geomean: 1.646s -> 1.576s (-4.3%)
  - Total time: 64.83s -> 62.82s (-3.1%)
- --rse:
  - Geomean: 0.922s -> 0.859s (-6.8%)
  - Total time: 27.09s -> 25.40s (-6.3%)
@tlively
tlively requested a review from a team as a code owner October 6, 2026 07:07
@tlively
tlively requested review from aheejin and removed request for a team October 6, 2026 07:07

This branch has not been deployed

No deployments
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.

1 participant