-
Notifications
You must be signed in to change notification settings - Fork 5.2k
JIT: Skip bitcast transformation for promoted locals #120435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
PTAL @dotnet/jit-contrib |
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
/ba-g Deadletter that succeeded on retry but is not being picked up by build analysis |
/backport to release/10.0 |
Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/18313339759 |
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 theLCL_FLD
path that DNERs the local, so make sure we still do that.Fix #120414