Skip to content

[Cranelift] resolves #13306, delete extend/reduce rule#13031

Merged
cfallin merged 1 commit intobytecodealliance:mainfrom
myunbin:fix-ext/red
Apr 10, 2026
Merged

[Cranelift] resolves #13306, delete extend/reduce rule#13031
cfallin merged 1 commit intobytecodealliance:mainfrom
myunbin:fix-ext/red

Conversation

@myunbin
Copy link
Copy Markdown
Contributor

@myunbin myunbin commented Apr 10, 2026

Cause

This regression was caused by the ireduce(xext(a) +/- xext(b)) -> a +/- b simplification rules added in cranelift/codegen/src/opts/arithmetic.isle.

These rewrites only check that both operands are extended to the same wide type (cty). They do not verify that the original operand types match the final reduced type (ty), or even match each other.

For example, a pattern such as:

  • ireduce.i32 (iadd.i64 (sextend.i64 x:i16) (uextend.i64 y:i32))

can be rewritten into:

  • iadd.i32 x, y

which is ill-typed, because x is still i16 while the new instruction expects both operands to be i32.
This matches the verifier failure we observed.

Resolution

We decided to remove these rules for now.

Thanks for reporting this issue.

[Cranelift] filetest error fix
@myunbin myunbin requested a review from a team as a code owner April 10, 2026 02:15
@myunbin myunbin requested review from fitzgen and removed request for a team April 10, 2026 02:15
Copy link
Copy Markdown
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

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

Thanks for the quick response!

@cfallin cfallin enabled auto-merge April 10, 2026 02:17
@cfallin cfallin added this pull request to the merge queue Apr 10, 2026
Merged via the queue into bytecodealliance:main with commit a7c6fdd Apr 10, 2026
79 checks passed
@myunbin myunbin deleted the fix-ext/red branch April 10, 2026 05:27
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