[libcxx-commits] [PATCH] D93233: [libc++] Replaces std::sort by Bitset sorting algorithm.

Nilay Vaish via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 12 18:49:03 PDT 2021


nilayvaish updated this revision to Diff 379248.
nilayvaish added a comment.

It seems that we can use _LIBCPP_HIDE_FROM_ABI with __bitsetsort_loop.  Causes the compiler to report errors like the following:

589 | __bitsetsort_loop(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,

  | ^~~~~~~~~~~~~~~~~

/home/libcxx-builder/.buildkite-agent/builds/75f0779fb064-1/llvm-project/libcxx-ci/build/generic-gcc/include/c++/v1/__algorithm/sort.h:642:34: note: called from here

  642 |       __bitsetsort_loop<_Compare>(__first, __ret.first, __comp, __buff, __limit);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/home/libcxx-builder/.buildkite-agent/builds/75f0779fb064-1/llvm-project/libcxx-ci/build/generic-gcc/include/c++/v1/__algorithm/sort.h:589:1: error: inlining failed in call to 'always_inline' 'void std::__1::__bitsetsort::__bitsetsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Compare, typename std::__1::iterator_traits<_RandomAccessIterator1>::value_type*, typename std::__1::iterator_traits<_RandomAccessIterator1>::difference_type) [with _Compare = std::__1::__less<double, double>; _RandomAccessIterator = double*]': recursive inlining

  589 | __bitsetsort_loop(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
      | ^~~~~~~~~~~~~~~~~

/home/libcxx-builder/.buildkite-agent/builds/75f0779fb064-1/llvm-project/libcxx-ci/build/generic-gcc/include/c++/v1/__algorithm/sort.h:645:34: note: called from here

  645 |       __bitsetsort_loop<_Compare>(__ret.first + 1, __last, __comp, __buff, __limit);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93233/new/

https://reviews.llvm.org/D93233

Files:
  libcxx/include/__algorithm/nth_element.h
  libcxx/include/__algorithm/sort.h
  libcxx/include/__algorithm/stable_sort.h
  libcxx/src/CMakeLists.txt
  libcxx/src/legacy-sort.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93233.379248.patch
Type: text/x-patch
Size: 68633 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211013/637a82a9/attachment-0001.bin>


More information about the libcxx-commits mailing list