subotac opened PR #14063 from subotac:fix/dse-divergent-store to bytecodealliance:main:
Fixes #14053.
Cranelift's post-dominator tree only considers paths that reach an explicit CFG exit. Dead-store elimination could therefore treat an overwriting store as inevitable even when another path entered a divergent region,
where a trap could expose the earlier memory state.Reject cross-block dead-store candidates when the original store can reach a divergent block without first passing through the overwriter. Add a CLIF regression covering the divergent path.
Testing:
- all 38 alias-analysis filetests
- all 187cranelift-codegenunit tests
- 22 doctests
-cargo clippy -p cranelift-codegen --all-targets -- -D warnings
- original WAST reproducer from #14053
subotac requested wasmtime-compiler-reviewers for a review on PR #14063.
subotac requested alexcrichton for a review on PR #14063.
github-actions[bot] added the label cranelift on PR #14063.
alexcrichton unassigned alexcrichton from PR #14063 Cranelift: Prevent DSE across divergent paths.
alexcrichton requested fitzgen for a review on PR #14063.
:cross_mark: cfallin closed without merge PR #14063.
cfallin commented on PR #14063:
This is addressed in a more principled way in #14080; closing.
Last updated: Aug 30 2026 at 10:08 UTC