[InstCombine] try to narrow more shifted bswap-of-zext
authorChenbing Zheng <Chenbing.Zheng@streamcomputing.com>
Fri, 6 May 2022 02:45:10 +0000 (10:45 +0800)
committerChenbing Zheng <Chenbing.Zheng@streamcomputing.com>
Fri, 6 May 2022 02:45:10 +0000 (10:45 +0800)
commit4c8c101b496431c468825518e9bd4375e8209ae9
tree0dcdacb8f2cd4b04e90354dcd3b303cb61fe1a6b
parent3b762b3ab8d205cd6a7d42c96d39d5f4f701f2ab
[InstCombine] try to narrow more shifted bswap-of-zext

Try to narrow more bswap, if the shift amount is less than the zext
(bswap (zext X)) >> C --> (zext (bswap X)) << C'

https://alive2.llvm.org/ce/z/i7ddjn

Reviewed By: RKSimon

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