[all-commits] [llvm/llvm-project] 333f50: [SmallVector] Optimize move assignment operator fo...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Jan 29 11:03:54 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 333f5019300c6e56782374627e64da0b62ffa3bc
      https://github.com/llvm/llvm-project/commit/333f5019300c6e56782374627e64da0b62ffa3bc
  Author: Fangrui Song <i at maskray.me>
  Date:   2022-01-29 (Sat, 29 Jan 2022)

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

  Log Message:
  -----------
  [SmallVector] Optimize move assignment operator for N==0 case

Due to the SmallVector hierarchy, N==0 cannot be leveraged by functions defined
in base classes. This patch special cases N==0 for SmallVector to save code size
and be slightly more efficient.

In a Release build of x86 only clang, .text is -3.34KiB smaller. In lld .text is
7.17KiB smaller.

Reviewed By: lichray

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




More information about the All-commits mailing list