diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-07-20 19:43:19 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-07-20 19:43:19 +0000 |
commit | f3a778d75759ebb5c388ae93522a4cfabaebbd13 (patch) | |
tree | 31199e9b98a3e813615d86824dfa3e1251dff1b9 /llvm/lib/CodeGen/SplitKit.cpp | |
parent | 27c12e088ee520c2416d30fcb292d6666377c01f (diff) | |
download | llvm-f3a778d75759ebb5c388ae93522a4cfabaebbd13.zip llvm-f3a778d75759ebb5c388ae93522a4cfabaebbd13.tar.gz llvm-f3a778d75759ebb5c388ae93522a4cfabaebbd13.tar.bz2 |
Implement LaneBitmask::getNumLanes and LaneBitmask::getHighestLane
This should eliminate most uses of countPopulation and Log2_32 on
the lane mask values.
llvm-svn: 308658
Diffstat (limited to 'llvm/lib/CodeGen/SplitKit.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SplitKit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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 @@ SlotIndex SplitEditor::buildCopy(unsigned FromReg, unsigned ToReg, 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 @@ SlotIndex SplitEditor::buildCopy(unsigned FromReg, unsigned ToReg, // 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; |