[all-commits] [llvm/llvm-project] 194d19: Introduce branchless sorting functions for sort3, ...

philnik777 via All-commits all-commits at lists.llvm.org
Fri Apr 8 00:05:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 194d1965d2c841fa81e107d19e27fae1467e7f11
      https://github.com/llvm/llvm-project/commit/194d1965d2c841fa81e107d19e27fae1467e7f11
  Author: Marco Gelmi <marcogelmi at google.com>
  Date:   2022-04-08 (Fri, 08 Apr 2022)

  Changed paths:
    M libcxx/benchmarks/algorithms.bench.cpp
    M libcxx/include/__algorithm/sort.h
    M libcxx/test/libcxx/algorithms/robust_against_copying_comparators.pass.cpp
    M libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/sort.pass.cpp

  Log Message:
  -----------
  Introduce branchless sorting functions for sort3, sort4 and sort5.

We are introducing branchless variants for sort3, sort4 and sort5.
These sorting functions have been generated using Reinforcement
Learning and aim to replace __sort3, __sort4 and __sort5 variants
for integral types.

The libc++ benchmarks were run on isolated machines for Skylake, ARM and
AMD architectures and achieve statistically significant improvement in
sorting random integers on test cases from sort1 to sort262144 for
uint32 and uint64.

A full performance overview for Intel Skylake, AMD and Arm can be
found here: https://bit.ly/3AtesYf

Reviewed By: ldionne, #libc, philnik

Spies: daniel.mankowitz, mgrang, Quuxplusone, andreamichi, philnik, libcxx-commits, nilayvaish, kristof.beyls

Differential Revision: https://reviews.llvm.org/D118029




More information about the All-commits mailing list