[InstCombine] try to narrow shifted bswap-of-zext
authorSanjay Patel <spatel@rotateright.com>
Tue, 22 Mar 2022 11:52:39 +0000 (07:52 -0400)
committerSanjay Patel <spatel@rotateright.com>
Tue, 22 Mar 2022 12:22:30 +0000 (08:22 -0400)
commit9e9bda2e8f5b88715bad767a4b7740df32b040d2
tree146f7366b6d29eff175cdb1974d157ed2693e022
parentc4f31d1da582232d206756b7246858f66ccdbd0c
[InstCombine] try to narrow shifted bswap-of-zext

This is the IR counterpart to 370ebc9d9a573d6
which provided a bswap narrowing fix for issue #53867.

Here we can be more general (although I'm not sure yet
what would happen for illegal types in codegen - too
rare to worry about?):
https://alive2.llvm.org/ce/z/3-CPfo

This will be more effective if we have moved the shift
after the bswap as proposed in D122010, but it is
independent of that patch.

Differential Revision: https://reviews.llvm.org/D122166
llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
llvm/test/Transforms/InstCombine/lshr.ll