[llvm] Make more math&bit functions constexpr, NFC (PR #145856)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 26 07:10:25 PDT 2025


================
@@ -200,7 +200,7 @@ template <typename T> [[nodiscard]] int countr_zero(T Val) {
 /// Only unsigned integral types are allowed.
 ///
 /// Returns std::numeric_limits<T>::digits on an input of 0.
-template <typename T> [[nodiscard]] int countl_zero(T Val) {
+template <typename T> [[nodiscard]] constexpr int countl_zero(T Val) {
----------------
kuhar wrote:

+1, this could be unit-tested

https://github.com/llvm/llvm-project/pull/145856


More information about the llvm-commits mailing list