Skip to content

x64: Prevent load sinking in simd f{min,max}#9144

Merged
fitzgen merged 1 commit intobytecodealliance:mainfrom
alexcrichton:x64-fix-fmin-fmax-with-load
Aug 19, 2024
Merged

x64: Prevent load sinking in simd f{min,max}#9144
fitzgen merged 1 commit intobytecodealliance:mainfrom
alexcrichton:x64-fix-fmin-fmax-with-load

Conversation

@alexcrichton
Copy link
Member

This commit fixes an issue where a Value was both load-sunk and used as-is, meaning it was both sunk and not. That triggered a panic in the backend since this isn't valid. The reason for this is due to how some ISLE rules were written where a Value was both implicitly coerced into an XmmMem and an Xmm. This issue is similar to #4815 for example. The fix in this commit is to force the operands into registers which prevents load sinking which wouldn't work here anyway.

This panic was introduced in #5841 which is quite old at this point. This bug does not affect WebAssembly translation due to how the v128 type maps to i8x16 in Cranelift by default.

Closes #9143

This commit fixes an issue where a `Value` was both load-sunk and used
as-is, meaning it was both sunk and not. That triggered a panic in the
backend since this isn't valid. The reason for this is due to how some
ISLE rules were written where a `Value` was both implicitly coerced into
an `XmmMem` and an `Xmm`. This issue is similar to bytecodealliance#4815 for example.
The fix in this commit is to force the operands into registers which
prevents load sinking which wouldn't work here anyway.

This panic was introduced in bytecodealliance#5841 which is quite old at this point.
This bug does not affect WebAssembly translation due to how the `v128`
type maps to `i8x16` in Cranelift by default.

Closes bytecodealliance#9143
@alexcrichton alexcrichton requested a review from a team as a code owner August 19, 2024 21:42
@alexcrichton alexcrichton requested review from elliottt and removed request for a team August 19, 2024 21:42
@fitzgen fitzgen enabled auto-merge August 19, 2024 21:44
@fitzgen fitzgen added this pull request to the merge queue Aug 19, 2024
Merged via the queue into bytecodealliance:main with commit d76df36 Aug 19, 2024
@alexcrichton alexcrichton deleted the x64-fix-fmin-fmax-with-load branch August 19, 2024 22:15
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.

Cranelift: Lowering fails for fmax and fmin of f32x4 on x64 backend

2 participants