[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)
commitde4379251ecbc083104a3796873b24ac677cd162
treeff78133627ab000380a618011c9140f88cbbc684
parent69dbbb0bca7c4eb1bc3e15412393d7d23fffbdd2
[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.

llvm-svn: 313908
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp