[all-commits] [llvm/llvm-project] d3b6e1: [ADT] Automatically forward llvm::sort to array_po...

Benjamin Kramer via All-commits all-commits at lists.llvm.org
Sat Mar 28 12:43:35 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d3b6e1f1f93e196669645fd04ab597f8df7580d1
      https://github.com/llvm/llvm-project/commit/d3b6e1f1f93e196669645fd04ab597f8df7580d1
  Author: Benjamin Kramer <benny.kra at googlemail.com>
  Date:   2020-03-28 (Sat, 28 Mar 2020)

  Changed paths:
    M llvm/include/llvm/ADT/STLExtras.h

  Log Message:
  -----------
  [ADT] Automatically forward llvm::sort to array_pod_sort if safe

This is safe if the iterator type is a pointer and the comparator is
stateless. The enable_if pattern I'm adding here only uses
array_pod_sort for the default comparator (std::less).

Using array_pod_sort has a potential performance impact, but I didn't
notice anything when testing clang. Sorting doesn't seem to be on the
hot path anywhere in LLVM.

Shrinks Release+Asserts clang by 73k.




More information about the All-commits mailing list