OSDN Git Service

[DAGCombiner] Slightly simplify some code by using APInt::isMask() and countTrailingO...
authorCraig Topper <craig.topper@intel.com>
Thu, 21 Sep 2017 20:12:19 +0000 (20:12 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 21 Sep 2017 20:12:19 +0000 (20:12 +0000)
commit5586629f295ea20c91eada84f30b895c974cee4f
tree6f1a3a202b84f133dadf9249e8d25722285cdb54
parent0e1ce271574ac0f9097000a08f13736c45352ced
[DAGCombiner] Slightly simplify some code by using APInt::isMask() and countTrailingOnes instead of getting active bits and checking if all the bits below that make a mask.

At least for the 64-bit and less case, we should be able to determine if we even have a mask without counting any bits. This also removes the need to explicitly check for 0 active bits, isMask will return false for 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313908 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp