Implement LaneBitmask::getNumLanes and LaneBitmask::getHighestLane
This should eliminate most uses of countPopulation and Log2_32 on
the lane mask values.
llvm-svn: 308658
diff --git a/llvm/lib/CodeGen/SplitKit.cpp b/llvm/lib/CodeGen/SplitKit.cpp
index 323045f..aaaa342b 100644
--- a/llvm/lib/CodeGen/SplitKit.cpp
+++ b/llvm/lib/CodeGen/SplitKit.cpp
@@ -552,7 +552,7 @@
if ((SubRegMask & ~LaneMask).any())
continue;
- unsigned PopCount = countPopulation(SubRegMask.getAsInteger());
+ unsigned PopCount = SubRegMask.getNumLanes();
PossibleIndexes.push_back(Idx);
if (PopCount > BestCover) {
BestCover = PopCount;
@@ -583,8 +583,8 @@
// Try to cover as much of the remaining lanes as possible but
// as few of the already covered lanes as possible.
- int Cover = countPopulation((SubRegMask & LanesLeft).getAsInteger())
- - countPopulation((SubRegMask & ~LanesLeft).getAsInteger());
+ int Cover = (SubRegMask & LanesLeft).getNumLanes()
+ - (SubRegMask & ~LanesLeft).getNumLanes();
if (Cover > BestCover) {
BestCover = Cover;
BestIdx = Idx;