Skip to content

ConstraintAnalysis: Remove older redundant constraints#8912

Merged
kripken merged 3 commits into
WebAssembly:mainfrom
kripken:constraint.deredundant
Jul 17, 2026
Merged

ConstraintAnalysis: Remove older redundant constraints#8912
kripken merged 3 commits into
WebAssembly:mainfrom
kripken:constraint.deredundant

Conversation

@kripken

@kripken kripken commented Jul 15, 2026

Copy link
Copy Markdown
Member

If we know x != 1 and we are told x == 0, then we can forget about
x != 1 and just store x == 0 (which implies x != 1).

@kripken
kripken requested a review from a team as a code owner July 15, 2026 20:13
@kripken
kripken requested review from tlively and removed request for a team July 15, 2026 20:13
Comment thread src/ir/constraint.cpp
for (auto& existing : *this) {
auto result = provesPair(c, existing);
if (result == True) {
existing = c;

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.

We'll have to remove existing and insert c to maintain the expected sorting of constraints.

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 catch, that other PR landed already...

I added a sort operation here.

@kripken
kripken merged commit 1377e42 into WebAssembly:main Jul 17, 2026
15 of 16 checks passed
@kripken
kripken deleted the constraint.deredundant branch July 17, 2026 14:09
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