Skip to content

Ensure that constant folding for SIMD shifts on xarch follow the correct behavior on overshift #98001

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

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

tannergooding
Copy link
Member

This resolves #93698 by ensuring the correct behavior is followed. As per the comments in the code, the xplat paths already enforce masking of the constant to ensure that it is "in range" and so they can never hit the constant folding path with an overshift. Only direct user usage of Sse2.ShiftLeftLogical (or similar) can hit this path.

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 5, 2024
@tannergooding
Copy link
Member Author

CC. @EgorBo, could you give this a review since you've also looked at the user reported issue already.

@ghost ghost assigned tannergooding Feb 5, 2024
@ghost
Copy link

ghost commented Feb 5, 2024

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

This resolves #93698 by ensuring the correct behavior is followed. As per the comments in the code, the xplat paths already enforce masking of the constant to ensure that it is "in range" and so they can never hit the constant folding path with an overshift. Only direct user usage of Sse2.ShiftLeftLogical (or similar) can hit this path.

Author: tannergooding
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@ryujit-bot
Copy link

Diff results for #98001

Throughput diffs

Throughput diffs for linux/arm64 ran on windows/x64

MinOpts (-0.00% to +0.01%)
Collection PDIFF
libraries.pmi.linux.arm64.checked.mch +0.01%

Details here


@ryujit-bot
Copy link

Diff results for #98001

Throughput diffs

Throughput diffs for windows/arm64 ran on windows/x64

MinOpts (-0.00% to +0.01%)
Collection PDIFF
libraries.pmi.windows.arm64.checked.mch +0.01%

Details here


@tannergooding tannergooding merged commit 85b5eab into dotnet:main Feb 6, 2024
@tannergooding tannergooding deleted the fix-93698 branch February 6, 2024 20:47
@tannergooding
Copy link
Member Author

/backport to release/8.0-staging

Copy link
Contributor

github-actions bot commented Feb 6, 2024

Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/7805915319

Copy link
Contributor

github-actions bot commented Feb 6, 2024

@tannergooding backporting to release/8.0-staging failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Ensure that constant folding for SIMD shifts on xarch follow the correct behavior on overshift
Using index info to reconstruct a base tree...
M	src/coreclr/jit/hwintrinsicxarch.cpp
M	src/coreclr/jit/valuenum.cpp
Falling back to patching base and 3-way merge...
Auto-merging src/coreclr/jit/valuenum.cpp
CONFLICT (content): Merge conflict in src/coreclr/jit/valuenum.cpp
Auto-merging src/coreclr/jit/hwintrinsicxarch.cpp
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Ensure that constant folding for SIMD shifts on xarch follow the correct behavior on overshift
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

Copy link
Contributor

github-actions bot commented Feb 6, 2024

@tannergooding an error occurred while backporting to release/8.0-staging, please check the run log for details!

Error: git am failed, most likely due to a merge conflict.

tannergooding added a commit to tannergooding/runtime that referenced this pull request Feb 6, 2024
…ect behavior on overshift (dotnet#98001)

* Ensure that constant folding for SIMD shifts on xarch follow the correct behavior on overshift

* Ensure we test Sse2.IsSupported
EgorBo pushed a commit that referenced this pull request Feb 10, 2024
…ect behavior on overshift (#98001) (#98066)

* Ensure that constant folding for SIMD shifts on xarch follow the correct behavior on overshift

* Ensure we test Sse2.IsSupported
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Constant vectors propagated incorrectly
3 participants