Stream: git-wasmtime

Topic: wasmtime / PR #14111 Cranelift: unwind last-store state a...


view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 19:52):

fitzgen opened PR #14111 from fitzgen:undo-last-store-on-dse to bytecodealliance:main:

Alias analysis's dead-store elimination removed the dead store's mem_values
entry, but left the region's last-store slot naming the instruction it had just
deleted. Leaving the removed-store meant that when we then reprocess the
overwriting store, we keyed its lookup on a removed instruction, found nothing,
and failed to notice that (for example) the overwriting store became idempotent
and could also be removed.

With this commit, each store now records the memory version it displaced, and
eliminating a dead store rolls that version back, so a chain like

v1 = load.i32 region0 v0
store region0 v2, v0  ;; dead
store region0 v1, v0  ;; idempotent once the dead store is gone

collapses in the single pass we actually make, rather than removing only one
link in the chain and requiring that we do N passes to fully clean up a chain of
N dead/idempotent stores. This code pattern the shape fused sync adapters emit
around the MAY_LEAVE flag and the relevant disas tests each lose a store as a
result.

Depends on https://github.com/bytecodealliance/wasmtime/pull/14109

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 19:52):

fitzgen requested alexcrichton for a review on PR #14111.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 19:52):

fitzgen requested wasmtime-compiler-reviewers for a review on PR #14111.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 19:52):

fitzgen requested wasmtime-core-reviewers for a review on PR #14111.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 20:11):

alexcrichton requested cfallin for a review on PR #14111.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 20:11):

alexcrichton unassigned alexcrichton from PR #14111 Cranelift: unwind last-store state after removing a dead store.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 20:50):

:thumbs_up: cfallin submitted PR review:

This looks right to me -- thanks for the detailed comments!

I was initially worried/trying to reason through the "patch" to analysis state with respect to possible inconsistencies with state propagated elsewhere. The thing that makes this work is that we only do the undo when the thing in the slot (whatever it is) is not observed; so we're free to change it.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 20:51):

cfallin commented on PR #14111:

(merge conflict at the moment)

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 21:56):

github-actions[bot] added the label cranelift on PR #14111.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 22:50):

fitzgen updated PR #14111.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 22:51):

fitzgen has enabled auto merge for PR #14111.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 22:59):

fitzgen added PR #14111 Cranelift: unwind last-store state after removing a dead store to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 23:34):

:check: fitzgen merged PR #14111.

view this post on Zulip Wasmtime GitHub notifications bot (Aug 10 2026 at 23:34):

fitzgen removed PR #14111 Cranelift: unwind last-store state after removing a dead store from the merge queue.


Last updated: Aug 30 2026 at 09:07 UTC