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

Haojian Wu via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 03:52:27 PDT 2025


hokein wrote:

> What is the motivation / use case for making these constexpr?

This improves the developer experience — for example, when using clangd, you can see the value of the expression on hover.

That said, I'm closing this PR for now. Since C++20 provides `std::countl_zero` as a `constexpr` function, it makes more sense to adopt that once we start compiling LLVM with `-std=c++20`.



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


More information about the llvm-commits mailing list