Skip to content

ConstraintAnalysis: Handle fallthrough values - #9000

Merged
kripken merged 5 commits into
WebAssembly:mainfrom
kripken:c.fallthru
Aug 14, 2026
Merged

ConstraintAnalysis: Handle fallthrough values#9000
kripken merged 5 commits into
WebAssembly:mainfrom
kripken:c.fallthru

Conversation

@kripken

@kripken kripken commented Aug 12, 2026

Copy link
Copy Markdown
Member

No description provided.

@kripken
kripken requested a review from a team as a code owner August 12, 2026 23:50
@kripken
kripken requested review from tlively and removed request for a team August 12, 2026 23:50
Comment on lines +540 to +542
// not change while falling through. For a local, the only way for the
// local to change while falling through is to go through a tee of that
// local - but that would keep the same value there anyhow. That is:

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.

It would be good to explain in the comment why it is not a problem if there is a tee to a different local.

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.

What did you have in mind? A tee of another local is like a write to linear memory, i.e., not relevant for that local - at least I'm not sure what you are suggesting to clarify here, sorry.

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.

If we have something like this:

(local.set $x
  (local.tee $y
    (i32.const $z)
  )
)

Then it would be good for the comment to explain that we won't miss collecting $y == $z because it will be visited separately.

Also, do we miss collecting $x == $y in this case?

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.

We handle tees since #8998

The basic block looks like

i32.const 
local.set $y
local.set $x

so we just execute those in sequence, not missing anything.

I added a comment on tees as you suggest.

@kripken
kripken merged commit e06e0f2 into WebAssembly:main Aug 14, 2026
16 checks passed
@kripken
kripken deleted the c.fallthru branch August 14, 2026 16:05
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