-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Avoid combining conditional select for reduction instrinsics #107207
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
Avoid combining conditional select for reduction instrinsics #107207
Conversation
|
Added a few conditional select tests for reduction intrinsics. Passes all stress tests. |
src/tests/JIT/Regression/JitBlue/Runtime_106868/Runtime_106868.cs
Outdated
Show resolved
Hide resolved
src/tests/JIT/Regression/JitBlue/Runtime_106868/Runtime_106868.cs
Outdated
Show resolved
Hide resolved
a74nh
left a comment
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. Happy we've got the extra template testing added too.
amanasifkhalid
left a comment
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 too. Thanks!
| // when the nestedOp is a reduce operation. | ||
|
|
||
| if (nestedOp1->IsMaskAllBitsSet() && | ||
| if (nestedOp1->IsMaskAllBitsSet() && !HWIntrinsicInfo::IsReduceOperation(nestedOp2Id) && |
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.
The reduction operations are notably a case where the pattern we want is somewhat inversed.
Rather than CndSel(mask, Op(value), merge) we want to instead want to check for Op(CndSel(mask, value, zero)) or similar.
We should have a tracking issue to ensure that happens for .NET 10
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.
Being looked at in #101973
|
@amanasifkhalid - any reason why this was not backported to release/9.0? |
|
@kunalspathak sorry I missed this one -- I'll kick off the backport now |
|
/backport to release/9.0 |
|
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/10820916154 |
|
@amanasifkhalid backporting to release/9.0 failed, the patch most likely resulted in conflicts: $ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Avoid combining conditional select for reduction instrinsics
Using index info to reconstruct a base tree...
M src/coreclr/jit/hwintrinsic.h
M src/coreclr/jit/hwintrinsiclistarm64sve.h
M src/coreclr/jit/lowerarmarch.cpp
M src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs
Falling back to patching base and 3-way merge...
Auto-merging src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs
Auto-merging src/coreclr/jit/lowerarmarch.cpp
CONFLICT (content): Merge conflict in src/coreclr/jit/lowerarmarch.cpp
Auto-merging src/coreclr/jit/hwintrinsiclistarm64sve.h
Auto-merging src/coreclr/jit/hwintrinsic.h
CONFLICT (content): Merge conflict in src/coreclr/jit/hwintrinsic.h
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Avoid combining conditional select for reduction instrinsics
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
|
@amanasifkhalid an error occurred while backporting to release/9.0, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
Co-authored-by: SwapnilGaikwad <[email protected]> Co-authored-by: Jeff Schwartz <[email protected]>
Fixes #106868
Fixes #106871
Fixes #106872
@a74nh @kunalspathak @dotnet/arm64-contrib @arch-arm64-sve @TIHan @amanasifkhalid