[Cranelift] resolves #13306, delete extend/reduce rule#13031
Merged
cfallin merged 1 commit intobytecodealliance:mainfrom Apr 10, 2026
Merged
[Cranelift] resolves #13306, delete extend/reduce rule#13031cfallin merged 1 commit intobytecodealliance:mainfrom
cfallin merged 1 commit intobytecodealliance:mainfrom
Conversation
[Cranelift] filetest error fix
cfallin
approved these changes
Apr 10, 2026
Member
cfallin
left a comment
There was a problem hiding this comment.
Thanks for the quick response!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cause
This regression was caused by the
ireduce(xext(a) +/- xext(b)) -> a +/- bsimplification rules added incranelift/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, ywhich is ill-typed, because
xis stilli16while the new instruction expects both operands to bei32.This matches the verifier failure we observed.
Resolution
We decided to remove these rules for now.
Thanks for reporting this issue.