[llvm] [ADT] Add llvm::countr_zero_constexpr (PR #164188)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 20 05:05:07 PDT 2025
================
@@ -151,7 +151,8 @@ template <typename T, typename = std::enable_if_t<std::is_unsigned_v<T>>>
/// Count the number of set bits in a value.
/// Ex. popcount(0xF000F000) = 8
/// Returns 0 if Value is zero.
-template <typename T> [[nodiscard]] inline int popcount(T Value) noexcept {
+template <typename T>
+[[nodiscard]] constexpr inline int popcount(T Value) noexcept {
----------------
kuhar wrote:
The `inline` is redundant here, no?
https://github.com/llvm/llvm-project/pull/164188
More information about the llvm-commits
mailing list