[Support] Use llvm::countr_zero and llvm::Log2_64 in APInt.cpp (NFC)
partMSB and partLSB never get 0 as the argument. That is, we don't rely on find{First,Last}Set's ability to return std::numeric_limits<T>::max() on input 0. This patch replaces partLSB and partMSB with llvm::countr_zero and llvm::Log2_64, respectively. FWIW, nobody in LLVM (except unit test MathExtrasTest.cpp) relies on find{First,Last}Set's ability to return std::numeric_limits<T>::max() on input 0.
Loading
Please sign in to comment