[InstCombine] fold popcount of exactly one bit to shift
authorSanjay Patel <spatel@rotateright.com>
Sun, 4 Apr 2021 15:38:09 +0000 (11:38 -0400)
committerSanjay Patel <spatel@rotateright.com>
Sun, 4 Apr 2021 15:43:49 +0000 (11:43 -0400)
commitc0645f13243cf574abd1f8d587dc22943b9dd95d
tree2e7aa8f17fccbcb6539b23a55850d6f264769d41
parentf18efb70c43b4c3f92f1bb0c213f6d7e09a09f4a
[InstCombine] fold popcount of exactly one bit to shift

This is discussed in https://llvm.org/PR48999 ,
but it does not solve that request.

The difference in the vector test shows that some
other logic transform is limited to scalar types.
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
llvm/test/Transforms/InstCombine/ctpop.ll