Repository navigation
JIT: Restore insertps source-lane fold for floating-point inserts - #135382
Merged
Merged
Conversation
The fold that rewrites Insert(v, CreateScalarUnsafe(v2.GetElement(n)), imm) into a single insertps selecting lane n via count_s (dotnet#130422) was gated on op2 still being a CreateScalarUnsafe node. dotnet#130444 later started removing floating-point CreateScalarUnsafe nodes whose user is another HW intrinsic, and since operands are lowered before their users, the wrapper is always gone by the time the Insert is lowered. The fold therefore never fired, leaving a redundant movshdup/unpckhps/shufps ahead of every such insertps. Also recognize the bare extraction as op2. Adds a disasm-checked test, since the existing functional test could not catch the lost fold. Fixes dotnet#134942 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Ruihan-Yin
marked this pull request as ready for review
October 8, 2026 18:21
Member
Author
Contributor
|
lgtm, thanks for looking at this Ruihan |
dhartglassMSFT
approved these changes
Oct 9, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The fold that rewrites Insert(v, CreateScalarUnsafe(v2.GetElement(n)), imm) into a single insertps selecting lane n via count_s (#130422) was gated on op2 still being a CreateScalarUnsafe node. #130444 later started removing floating-point CreateScalarUnsafe nodes whose user is another HW intrinsic, and since operands are lowered before their users, the wrapper is always gone by the time the Insert is lowered. The fold therefore never fired, leaving a redundant movshdup/unpckhps/shufps ahead of every such insertps.
Also recognize the bare extraction as op2. Adds a disasm-checked test, since the existing functional test could not catch the lost fold.
Fixes #134942