-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Better codegen for truncated bswap #50910
Comments
Probably need some enhancement to known bits and/or demanded bits to see that we have masked off the high byte (72057594037927935 == 0x00ff...). |
llvm::recognizeBSwapOrBitReverseIdiom could handle this, but it might bail out due to the trunc() user of the or() |
Do you know why we have the trunc user check? If I just comment it out, this bug is fixed with no regression test failures. |
It looks like it first appeared in https://reviews.llvm.org/D20591 When I refactored recognizeBSwapOrBitReverseIdiom to better handle truncs in https://reviews.llvm.org/D88316 it looks like I kept it, but I'm not certain if it was necessary any more. @rotateright Are you up for dealing with this? |
Sure - it should just be a matter of removing that check and cleaning up the code. I'll look over the tests to see if there was a test that became moot with D88316. |
I added a trunc test that I thought might work with: |
Thanks @rotateright |
Thanks for the fix |
Extended Description
Trunk -O3:
ICC -O3:
https://alive2.llvm.org/ce/z/loQjOQ
The text was updated successfully, but these errors were encountered: