[llvm] Move bit counting functions to bit.h (NFC)
This patch provides C++20-style countl_zero, countr_zero, countl_one, and countr_one in bit.h. Existing functions like countLeadingZeros become wrappers around the new functions. Note that I cannot quite declare countLeadingZeros as: template <class T> using countLeadingZeros = countl_zero<T>; because countl_zero returns int, whereas countLeadingZeros returns unsigned. Differential Revision: https://reviews.llvm.org/D142078
Loading
Please sign in to comment