-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[release/9.0] JIT ARM64-SVE: Backport "Avoid combining conditional select for reduction instrinsics" (#107207) #107722
[release/9.0] JIT ARM64-SVE: Backport "Avoid combining conditional select for reduction instrinsics" (#107207) #107722
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
@kunalspathak PTAL, I had to open this manually due to merge conflicts around the ordering of |
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. Thanks!
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.
approved. we can merge when ready
@jeffschwMSFT could you merge this when you have a moment, please? #107725 needs to be merged on top of this PR. Thanks! |
Backport of #107207 to release/9.0
/cc @kunalspathak @SwapnilGaikwad
Customer Impact
For ARM SVE reduction intrinsics, or intrinsics that produce a scalar value, we currently do not support merging
ConditionalSelect
uses into the intrinsic itself as a mask operation. So for patterns likeSve.AddAcross(Sve.ConditionalSelect(mask, vec, zero))
, we only support emitting aSEL
to first select the correct entries in the vector, and then passing this vector toAddAcross
; #101973 tracks merging these two instructions into one for .NET 10.When trying to merge
ConditionalSelect
operands of other intrinsics, the JIT did not skip this optimization for reduction intrinsics, breaking various invariants. This change ensures the JIT will not try to mergeConditionalSelect
into reduction intrinsics, and adds relevant tests.Regression
This was introduced with SVE support, which is new in .NET 9.
Testing
Added regression tests, and expanded existing SVE testing to cover more
ConditionalSelect
cases.Risk
Low. This is specific to SVE support, which is experimental in .NET 9.