[InstSimplify] Fold (ctpop(X) == N) || (X != 0) into X != 0 where N > 0
authorHirochika Matsumoto <git@hkmatsumoto.com>
Wed, 30 Mar 2022 18:53:11 +0000 (03:53 +0900)
committerHirochika Matsumoto <git@hkmatsumoto.com>
Mon, 4 Apr 2022 14:23:34 +0000 (23:23 +0900)
commit447a4485c56641b57f762d87dc2f11da8801d75c
tree1c404ec61af76d9eba2a3099c4a399812893a5e7
parenta97e3097cfdfea5a20d3b867571c42ffa0666b01
[InstSimplify] Fold (ctpop(X) == N) || (X != 0) into X != 0 where N > 0

(ctpop(X) == N) || (X != 0) --> (X != 0) https://alive2.llvm.org/ce/z/udgUVV
(ctpop(X) != N) && (X == 0) --> (X == 0) https://alive2.llvm.org/ce/z/9dq-cR

Differential Revision: https://reviews.llvm.org/D122757
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/and-or-icmp-ctpop.ll