-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Arm64 SVE: Fix conditionalselect with constant arguments #116852
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
base: main
Are you sure you want to change the base?
Conversation
Fixes dotnet#116847 When folding, allow arg1 to be a constant mask
@dotnet/arm64-contrib @kunalspathak |
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
/azp run Antigen, Fuzzlyn |
Azure Pipelines successfully started running 2 pipeline(s). |
src/coreclr/jit/simd.h
Outdated
// depending on if the corresponding input element | ||
// has its least significant bit set | ||
|
||
bool isSet = static_cast<uint64_t>(1) << (i * sizeof(TBase)); |
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.
wait, we should be check isSet
with content of input0
, right?
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.
wait, we should be check
isSet
with content ofinput0
, right?
Yes, I should be checking significant bit of input0
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.
There is a bug in EvaluateSimdVectorToPattern
where we are not validating it against the contents of arg0
.
The simd.h changes in this PR are out of date. We should wait for #116854 to be merged first. |
i will hold off reviewing this until #116854 is merged. |
Fuzzlyn was showing some errors with
This is due to The fix is closely related to the fix in this PR, so I've put it into this PR with a test. I've also updated simd.h to the latest from #116854 |
This reverts commit b923b28.
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
I've put another closely related Fuzzlyn failure into this PR.
What happens here is all the inputs to the conditionalselect are constants, so it is optimised away into a single vector. It is then used as a mask in the next function call, so is optimised to a cns mask. The mask cannot be converted into a valid pattern during codegen (for use in a ptrue), so it asserts. The fix is to convert it to a constant vector with conversion to mask. Best way to do that is during lowering (see |
This reverts commit c96e38c.
Change-Id: I7951b70aec9aaef5521e100d30737b5a4d332b38
With #116991 applied on top I don't see any fuzzlyn errors over 50mins. I'm happy with this PR now. |
Updated as per review comments. Fuzzlyn still looks good when #116991 is applied. |
Fixes #116847
When folding, allow arg1 to be a constant mask