kestred removed the review request for wasmtime-compiler-reviewers from PR #15330.
kestred opened PR #15330 from kestred:cranelift-gvn-depth to bytecodealliance:main:
Fixes #15263.
depth_of_block_in_gvn_mapfinds a block by scanninggvn_map_blocks, which is quadratic when the dominator tree is
deep. This records each block's index when it is pushed and looks it up, with a debug assertion that the two agree.For my ordinary test corpus (~20 programs of various shapes) compile time is unchanged.
For a pathological program (a chain of 16,384 blocks) at
opt_level=speed, the egraph pass goes from 1.28 s to 0.23 s.
kestred requested cfallin for a review on PR #15330.
kestred requested wasmtime-compiler-reviewers for a review on PR #15330.
:thumbs_up: cfallin submitted PR review:
Thanks!
Simple change, nice speedup, looks great.
Only a minor nit: we try to avoid
as Tinteger casts since they silently truncate (here unlikely/impossible due to input-size limits but we keep the general rule to make audits easier). Can you useu32::try_from(...).expect(...)and likewise forusizehere? Happy to merge once that's changed.
kestred updated PR #15330.
:thumbs_up: cfallin submitted PR review.
cfallin added PR #15330 Cranelift: look up a block's GVN depth instead of scanning for it to the merge queue.
:check: cfallin merged PR #15330.
cfallin removed PR #15330 Cranelift: look up a block's GVN depth instead of scanning for it from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC