[InstCombine] fold 'not' of ctpop in parity pattern
authorSanjay Patel <spatel@rotateright.com>
Fri, 23 Apr 2021 17:19:46 +0000 (13:19 -0400)
committerSanjay Patel <spatel@rotateright.com>
Fri, 23 Apr 2021 17:23:24 +0000 (13:23 -0400)
commite10d7d455d4ec0dccab9a74764a8988e1301069f
tree708ca069df9b94f3aa27dd41220e9e1f4cfe21cc
parentd5175005abe15b041021f36de20cb5fde9a0685c
[InstCombine] fold 'not' of ctpop in parity pattern

As discussed in https://llvm.org/PR50096 , we could
convert the 'not' into a 'sub' and see the same
fold. That's because we already have another demanded
bits optimization for 'sub'.

We could add a related transform for
odd-number-of-type-bits, but that seems unlikely
to be practical.

https://alive2.llvm.org/ce/z/TWJZXr
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
llvm/test/Transforms/InstCombine/ctpop.ll