[ADT] Add llvm::popcount to <bit> helper wrapper
This patch proposes to move the llvm::detail::PopulationCounter internal helpers into ADT/bit.h and provide a llvm::popcount implementation. I've left the countPopulation implementation in place in MathExtras.h for now, but updated it to use llvm::popcount. Hopefully I've got the type_traits correct - I don't use them very often. Someday we'll move to C++20 with an actual <bit> std header, and we already have this header in place to simplify matters. We'd probably benefit from moving the other <bit> helpers here at some point, but this is a first step. Differential Revision: https://reviews.llvm.org/D132407
Loading
Please sign in to comment