Skip to content

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Oct 6, 2025

The bitcast transformation produces BITCAST(LCL_VAR), but for SIMDs the local can be promoted and this ends up resulting in invalid IR. We would normally go through the LCL_FLD path that DNERs the local, so make sure we still do that.

Fix #120414

The bitcast transformation produces `BITCAST(LCL_VAR)`, but for SIMDs
the local can be promoted and this ends up resulting in invalid IR. We
would normally go through the `LCL_FLD` path that DNERs the local, so
make sure we still do that.
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 6, 2025
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch jakobbotsch marked this pull request as ready for review October 6, 2025 14:26
@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 14:26
@jakobbotsch
Copy link
Member Author

PTAL @dotnet/jit-contrib

No diffs

@jakobbotsch jakobbotsch requested a review from a team October 6, 2025 14:26
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a JIT bug where bitcast transformations on promoted SIMD locals resulted in invalid IR. The fix prevents bitcast transformation for promoted locals, ensuring they go through the proper LCL_FLD path that handles promoted locals correctly.

Key changes:

  • Added a condition to skip bitcast transformation when the local variable is promoted
  • Added a regression test to verify the fix works correctly

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/coreclr/jit/lclmorph.cpp Added check to prevent bitcast transformation on promoted locals
src/tests/JIT/Regression/JitBlue/Runtime_120414/Runtime_120414.cs Regression test using Vector2/Vector128 operations to reproduce the bug
src/tests/JIT/Regression/JitBlue/Runtime_120414/Runtime_120414.csproj Project file for the regression test

Copy link
Member

@JulieLeeMSFT JulieLeeMSFT left a comment

Choose a reason for hiding this comment

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

LGTM.

@jakobbotsch
Copy link
Member Author

/ba-g Deadletter that succeeded on retry but is not being picked up by build analysis

@jakobbotsch jakobbotsch merged commit f981e2a into dotnet:main Oct 7, 2025
118 of 120 checks passed
@jakobbotsch
Copy link
Member Author

/backport to release/10.0

Copy link
Contributor

github-actions bot commented Oct 7, 2025

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/18313339759

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARM64 SIMD fails assertion where x86-64 SIMD does not

3 participants