Skip to content
Commit 49f7d2c4 authored by Kazu Hirata's avatar Kazu Hirata
Browse files

[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.
parent 1a0ec914
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment