[InstCombine] recognizeBSwapOrBitReverseIdiom - support for 'partial' bswap patterns...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 2 Oct 2020 16:15:32 +0000 (17:15 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 2 Oct 2020 16:25:12 +0000 (17:25 +0100)
commit3d14a1e982ad27111346471564d575ad5efc6419
tree4d5753951219800e00eeb29df99dd252e95fef94
parent0347f3ea720b16305d77449f9868255496e0b27c
[InstCombine] recognizeBSwapOrBitReverseIdiom - support for 'partial' bswap patterns (PR47191)

If we're bswap'ing some bytes and zero'ing the remainder we can perform this as a bswap+mask which helps us match 'partial' bswaps as a first step towards folding into a more complex bswap pattern.

Differential Revision: https://reviews.llvm.org/D88578
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Transforms/InstCombine/bswap.ll