Skip to content

ConstraintAnalysis: Add more simple inequalities - #8955

Open
kripken wants to merge 3 commits into
WebAssembly:mainfrom
kripken:cineq.moar
Open

ConstraintAnalysis: Add more simple inequalities#8955
kripken wants to merge 3 commits into
WebAssembly:mainfrom
kripken:cineq.moar

Conversation

@kripken

@kripken kripken commented Jul 30, 2026

Copy link
Copy Markdown
Member

These are the last pieces needed before the next PR, which will handle
loop overflows.

@kripken
kripken requested a review from tlively July 30, 2026 19:43
@kripken
kripken requested a review from a team as a code owner July 30, 2026 19:43
Comment thread src/ir/constraint.cpp
Comment on lines +314 to +315
if (ac->type == bc->type && ac->type.isInteger() &&
ac->add(Literal::makeFromInt32(1, ac->type)) == *bc) {

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 need to handle overflow here, right? IIRC, we don't consider x > UINT_MAX a contradiction, so we can end up with x > UINT_MAX || x >= 0. Then we would incorrectly turn this into x > UINT_MAX and misoptimize subsequent code.

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