[llvm] RuntimeLibcalls: Add bitset for available libcalls (PR #150869)

David Spickett via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 03:09:10 PDT 2025


DavidSpickett wrote:

This is failing to build on 32-bit:
```
/usr/lib/gcc/arm-linux-gnueabihf/14/../../../../include/c++/14/array:208:2: note: non-constexpr function '__glibcxx_assert_fail' cannot be used in a constant expression
  208 |         __glibcxx_requires_subscript(__n);
      |         ^
/usr/lib/gcc/arm-linux-gnueabihf/14/../../../../include/c++/14/debug/assertions.h:44:3: note: expanded from macro '__glibcxx_requires_subscript'
   44 |   __glibcxx_assert(_N < this->size())
      |   ^
/usr/lib/gcc/arm-linux-gnueabihf/14/../../../../include/arm-linux-gnueabihf/c++/14/bits/c++config.h:597:7: note: expanded from macro '__glibcxx_assert'
  597 |       _GLIBCXX_ASSERT_FAIL(cond);                                       \
      |       ^
/usr/lib/gcc/arm-linux-gnueabihf/14/../../../../include/arm-linux-gnueabihf/c++/14/bits/c++config.h:586:3: note: expanded from macro '_GLIBCXX_ASSERT_FAIL'
  586 |   std::__glibcxx_assert_fail(__FILE__, __LINE__, __PRETTY_FUNCTION__,   \
      |   ^
/home/david.spickett/llvm-project/llvm/include/llvm/ADT/Bitset.h:53:9: note: in call to 'this->Bits.operator[](55)'
   53 |         Bits[2 * I + 1] = static_cast<uint32_t>(Elt >> 32);
      |         ^~~~~~~~~~~~~~~
/home/david.spickett/llvm-project/llvm/include/llvm/IR/RuntimeLibcalls.h:64:9: note: in call to 'Bitset({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 18446744073707454464ULL, 13468196062572838911ULL, 8068962058563468478LL, 5908723102954010539LL, 15528411416389222482ULL, 279223176897142645LL, 3746994889972252672LL, 18440270288368131053ULL, 8953156059212546047LL, 15913167699476203134ULL, 7906048719147421110LL, 7903888500135409335LL, 15083311574455LL, 7905743145847713152LL, 14043})'
   64 |       : Bitset(Src) {}
      |         ^~~~~~~~~~~
/home/david.spickett/build-llvm-arm/include/llvm/IR/RuntimeLibcalls.inc:30015:40: note: in call to 'LibcallImplBitset({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 210, 18446744073707454464ULL, 13468196062572838911ULL, 8068962058563468478LL, 5908723102954010539LL, 15528411416389222482ULL, 279223176897142645LL, 3746994889972252672LL, 18440270288368131053ULL, 8953156059212546047LL, 15913167699476203134ULL, 7906048719147421110LL, 7903888500135409335LL, 15083311574455LL, 7905743145847713152LL, 14043})'
 30015 |     static constexpr LibcallImplBitset SystemAvailableImpls({
       |                                        ^~~~~~~~~~~~~~~~~~~~~~
 30016 |       0x00000000000000, 0x00000000000000, 0x00000000000000, 0x00000000000000,
       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 30017 |       0x00000000000000, 0x00000000000000, 0x00000000000000, 0x00000000000000,
       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 30018 |       0x00000000000000, 0x00000000000000, 0x00000000000000, 0x00000000000000,
       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 30019 |       0x000000000000d2, 0xffffffffffe00000, 0xbae8a4f61af7ffff, 0x6ffab63db6c7bcbe,
       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 30020 |       0x5200005b3bb7b7ab, 0xd77fffe900000052, 0x3e0000000029f75, 0x3400000000000000,
       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 30021 |       0xffe90020645f5bed, 0x7c3fffffffffffff, 0xdcd6edb60a7fc67e, 0x6db7ed6c09b6cdb6,
       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 30022 |       0x6db040b6daddb6b7, 0x000db7db6dadb7, 0x6db6d78135bb6d80, 0x000000000036db
       |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 30023 |     });
       |     ~~
/usr/lib/gcc/arm-linux-gnueabihf/14/../../../../include/arm-linux-gnueabihf/c++/14/bits/c++config.h:579:3: note: declared here
  579 |   __glibcxx_assert_fail /* Called when a precondition violation is detected. */
      |   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
```
I'll merge my other fix to BitSet and figure out how to fix it from there.

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


More information about the llvm-commits mailing list