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
aarch64 global isel backend miscompiles funnel shift with undef amount #57256
Comments
@llvm/issue-subscribers-backend-aarch64 |
@llvm/issue-subscribers-backend-aarch64 |
here are a couple more that fit the same pattern, probably more places where freeze is needed https://gcc.godbolt.org/z/7zP4dKTGo both of these are straight out of our unit test suite, no fuzzing is occurring |
https://reviews.llvm.org/D135020 fixes the |
This fixes the `urem_undef_lhs` case in the following: https://gcc.godbolt.org/z/Wo9x7o679 Also see #57256 for more related bugs. This is equivalent to the undef bits in `simplifyDivRem` in the DAGCombiner. Differential Revision: https://reviews.llvm.org/D135020
Funnel shifts: https://reviews.llvm.org/D135022 I just matched the SelectionDAG behaviour here, which for scalars replaces the shift with the first or second operand. I'm not sure if that's the correct behaviour (since I can't seem to find the code that actually handles this), but it's more correct than not emitting anything. |
SDAG does this, GISel doesn't. See https://gcc.godbolt.org/z/sqjMx3Tfv More context: #57256 Differential Revision: https://reviews.llvm.org/D135021
current status is that I'm seeing this issue on funnel shift (@ornata has a patch in flight) and then also srem: https://gcc.godbolt.org/z/Td4qEaz43 |
Picking this back up, I think we need to address the concerns about the differences between scalar/vectors in https://reviews.llvm.org/D135022 and then implement fold for SREM as well. |
here's one from our unit tests:
the global isel backend returns an arbitrary 32-bit value: https://gcc.godbolt.org/z/Yvbx9P7K4
but that's not OK. this is the set of permissible return values:
cc @aemerson @ornata @nunoplopes @ryan-berger @nbushehri @zhengyang92 @efriedma-quic
The text was updated successfully, but these errors were encountered: