[all-commits] [llvm/llvm-project] 6e92f7: [ADT] Add bit_ceil_constexpr (#164115)

Kazu Hirata via All-commits all-commits at lists.llvm.org
Sat Oct 18 15:41:53 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6e92f7e9584c257b91e7b28e68e90f9edd718cbc
      https://github.com/llvm/llvm-project/commit/6e92f7e9584c257b91e7b28e68e90f9edd718cbc
  Author: Kazu Hirata <kazu at google.com>
  Date:   2025-10-18 (Sat, 18 Oct 2025)

  Changed paths:
    M llvm/include/llvm/ADT/SmallPtrSet.h
    M llvm/include/llvm/ADT/bit.h
    M llvm/unittests/ADT/BitTest.cpp

  Log Message:
  -----------
  [ADT] Add bit_ceil_constexpr (#164115)

This patch adds llvm::bit_ceil_constexpr, a constexpr version of
llvm::bit_ceil.

The new function is intended to serve as a marker.  When we switch to
C++20, we will most likely go through functions in llvm/ADT/bit.h and
replace them with their counterparts from <bit>.  With
llvm::bit_ceil_constexpr, we can easily replace its use with
std::bit_ceil.

This patch replaces RoundUpToPowerOfTwo in SmallPtrSet.h the new
function.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list