OSDN Git Service

[SDAG] expand ctpop != 1
authorSanjay Patel <spatel@rotateright.com>
Tue, 25 Jun 2019 14:46:52 +0000 (14:46 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 25 Jun 2019 14:46:52 +0000 (14:46 +0000)
commit4ad4edc5302f50c1c85a5ff0f59d3fde72e5ec32
treeca7b538eef2fb09e5d4a6888fadbdc27a6786f49
parentad6dedb743ae8160c7e58cfe82d833c78d9a7fec
[SDAG] expand ctpop != 1

Change the generic ctpop expansion to more efficiently handle a
check for not-a-power-of-two value:
(ctpop x) != 1 --> (x == 0) || ((x & x-1) != 0)

This is the inverted predicate sibling pattern that was added with:
D63004

This should have been done before I changed IR canonicalization to
favor this form with:
rL364246
...so if this requires revert/changing, the earlier commit may also
need to modified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364319 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/X86/ctpop-combine.ll