Skip to content

Constraints: Propagate constants when proving - #9047

Merged
kripken merged 2 commits into
WebAssembly:mainfrom
kripken:c.bettr
Aug 27, 2026
Merged

Constraints: Propagate constants when proving#9047
kripken merged 2 commits into
WebAssembly:mainfrom
kripken:c.bettr

Conversation

@kripken

@kripken kripken commented Aug 26, 2026

Copy link
Copy Markdown
Member

Rather than seeing e.g. x <= .. and trying to solve it using what we know about
x, if the rhs is another local y, we can use what we know about y. E.g.
x <= y, when y == 10, is x <= 10.

@kripken
kripken requested a review from a team as a code owner August 26, 2026 20:13
@kripken
kripken requested review from aheejin and removed request for a team August 26, 2026 20:13
Comment thread src/ir/constraint.cpp
}
}

Result BasicBlockConstraintMap::proves(LocalConstraint condition) const {

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.

Do we plan to do more here? Like, if the otherConstraints is not equal to a literal but less than / greater than a literal, that also can help prove or disprove a constraint.

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.

Good point, yeah, we can do better here, adding constraints for such cases. I added a TODO.

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

3 participants