Skip to content

feat: fix big endian shuffle vector miscompile #68673

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 1 commit into from
Nov 20, 2023

Conversation

hstk30-hw
Copy link
Contributor

fix #65884

@github-actions
Copy link

github-actions bot commented Oct 10, 2023

✅ With the latest revision this PR passed the C/C++ code formatter.

@hstk30-hw hstk30-hw force-pushed the fix_be_shuffle_vector_miscompile branch 3 times, most recently from b0d9595 to ec74c1e Compare October 12, 2023 08:36
@davemgreen
Copy link
Collaborator

Also - AArch64ISD::NVCAST == ISD::BITCAST under LE, so it can be used in both cases.

@hstk30-hw hstk30-hw force-pushed the fix_be_shuffle_vector_miscompile branch from ec74c1e to 7f20eab Compare October 12, 2023 12:53
@davemgreen
Copy link
Collaborator

It looks like there might be a few failing tests, possibly that need updating?

It is possible that there are a number of places where bitcast is being used incorrectly under BE.

@hstk30-hw
Copy link
Contributor Author

Yes,I need time to check it. Some tests are hard to check manually, it seem generates automatilly for be.

@hstk30-hw hstk30-hw force-pushed the fix_be_shuffle_vector_miscompile branch 4 times, most recently from 5162649 to 98bf8f8 Compare November 6, 2023 08:41
@hstk30-hw
Copy link
Contributor Author

Also - AArch64ISD::NVCAST == ISD::BITCAST under LE, so it can be used in both cases.

Replace ISD::BITCAST to AArch64ISD::NVCAST simply will let this commit: 62fc58a not work.

Check it plz. @davemgreen

@hstk30-hw hstk30-hw requested a review from davemgreen November 8, 2023 01:20
@hstk30-hw
Copy link
Contributor Author

hstk30-hw commented Nov 13, 2023

Ping ... @davemgreen

@hstk30-hw hstk30-hw closed this Nov 16, 2023
@hstk30-hw hstk30-hw reopened this Nov 16, 2023
@hstk30-hw
Copy link
Contributor Author

Ping @nikic @ostannard @efriedma-quic

Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi - sorry about the delay it took a while to look through the details. There might be a way to convert NVCAST to BITCAST under LE and adjust all the needed patterns to handle either, but it doesn't look simple and this seems like a good fix for now. It checked out OK in all the tests I tried. There are some comments about adjusting the new test case below, but otherwise this looks OK to me.

@hstk30-hw hstk30-hw force-pushed the fix_be_shuffle_vector_miscompile branch from 98bf8f8 to 0206a97 Compare November 19, 2023 14:52
Copy link
Collaborator

@davemgreen davemgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM

@hstk30-hw
Copy link
Contributor Author

"hstk30-hw [email protected]"
Merge it for me, plz.

@davemgreen davemgreen merged commit abcbca2 into llvm:main Nov 20, 2023
sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AArch64] neon big endian miscompiled
3 participants