Skip to content

Cranelift: Prevent DSE across divergent paths - #14063

Open
subotac wants to merge 1 commit into
bytecodealliance:mainfrom
subotac:fix/dse-divergent-store
Open

Cranelift: Prevent DSE across divergent paths#14063
subotac wants to merge 1 commit into
bytecodealliance:mainfrom
subotac:fix/dse-divergent-store

Conversation

@subotac

@subotac subotac commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

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:

@subotac
subotac requested a review from a team as a code owner August 2, 2026 14:13
@subotac
subotac requested review from alexcrichton and removed request for a team August 2, 2026 14:13
@github-actions github-actions Bot added the cranelift Issues related to the Cranelift code generator label Aug 2, 2026
@alexcrichton
alexcrichton requested review from fitzgen and removed request for alexcrichton August 2, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cranelift Issues related to the Cranelift code generator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dead-store-elimintation removes visible stores from divergent paths

1 participant