[all-commits] [llvm/llvm-project] f6cce5: [Support] Change StringMap hash function from xxHa...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sat Jul 22 16:51:00 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f6cce566b3d06de70efb9271ea9253b1d5845920
      https://github.com/llvm/llvm-project/commit/f6cce566b3d06de70efb9271ea9253b1d5845920
  Author: Fangrui Song <i at maskray.me>
  Date:   2023-07-22 (Sat, 22 Jul 2023)

  Changed paths:
    M llvm/lib/Support/StringMap.cpp
    M llvm/test/ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s

  Log Message:
  -----------
  [Support] Change StringMap hash function from xxHash64 to xxh3_64bits

Similar to D142862.

xxh3 is significantly faster than xxh64. Switch to xxh3, as we did for
for lld and llvm-dwarfutil to increase performance (D154813 D155675).
While I think StringMap is not a bottleneck for most applications, it
seems good to eliminate the slower xxh64.
In addition, according to Erik Desjardins, an artificial benchmark of
Rust with very large constant strings improves by ~3% locally.

I have fixed all found issues (~20) separately, but one is remaining:

* ExecutionEngine/RuntimeDyld/ARM/MachO_ARM_PIC_relocations.s has a
  failure due to StringMap iteration order. It now passes
  with LLVM_ENABLE_REVERSE_ITERATION=on while failing with
  LLVM_ENABLE_REVERSE_ITERATION=off.

Reviewed By: erikdesjardins

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




More information about the All-commits mailing list