[InstCombine] reduce more checks for power-of-2-or-zero using ctpop
authorSanjay Patel <spatel@rotateright.com>
Mon, 1 Jul 2019 22:00:00 +0000 (22:00 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 1 Jul 2019 22:00:00 +0000 (22:00 +0000)
commitddc1b40f26b210a1650454e1ef232cf5f1b6775f
tree4025f200622f8c8427b677092a766ee0d3b9ad9d
parentfc18b7cbc12d82968d881d00ed8bdc25561daa34
[InstCombine] reduce more checks for power-of-2-or-zero using ctpop

Extends the transform from:
rL364341
...to include another (more common?) pattern that tests whether a
value is a power-of-2 (including or excluding zero).

llvm-svn: 364856
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/ispow2.ll