Skip to content

ConstraintAnalysis: Fix Pops and non-nullable LocalSets#8895

Merged
kripken merged 10 commits into
WebAssembly:mainfrom
kripken:constraint.eh
Jul 13, 2026
Merged

ConstraintAnalysis: Fix Pops and non-nullable LocalSets#8895
kripken merged 10 commits into
WebAssembly:mainfrom
kripken:constraint.eh

Conversation

@kripken

@kripken kripken commented Jul 10, 2026

Copy link
Copy Markdown
Member

We cannot just remove such IR, even if unreachable. Use
getDroppedChildrenAndAppend and also run EH fixups.

@kripken kripken requested a review from a team as a code owner July 10, 2026 20:56
@kripken kripken requested review from tlively and removed request for a team July 10, 2026 20:56
Comment on lines +3503 to +3504
;; internal errors, and we can just optimize this to unreachable (though we
;; keep the local.set, because of non-nullable local validation).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the unreachable that was appended, but where are the dropped children? And what's the connection to non-nullable local validation here? The i32 local is not non-nullable.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getDroppedChildren handles effects in pops and local.set etc., by keeping them around if necessary, with their children.

Good point that it might not need to do so for locals that are not non-nullable. But it isn't important to optimize that here, I think - other passes will.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(getDroppedChildren has a flag, the last parameter, that controls whether to ignore parent effects or not. Here we use the default, which does not ignore them)

@kripken kripken merged commit 48858e8 into WebAssembly:main Jul 13, 2026
16 checks passed
@kripken kripken deleted the constraint.eh branch July 13, 2026 22:28
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.

2 participants