[PATCH] D142862: [Support] change StringMap hash function from djbHash to xxHash

Erik Desjardins via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 29 20:02:54 PST 2023


erikdesjardins created this revision.
Herald added subscribers: Moerafaat, zero9178, Enna1, bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, wenlei, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini, thopre, kadircet, arphaman, JDevlieghere, hiraditya.
Herald added a reviewer: JDevlieghere.
Herald added a project: All.
erikdesjardins requested review of this revision.
Herald added subscribers: cfe-commits, llvm-commits, lldb-commits, Sanitizers, stephenneuendorffer, nicolasvasilache.
Herald added projects: clang, Sanitizers, LLDB, MLIR, LLVM, clang-tools-extra.

Depends on https://reviews.llvm.org/D142861.

Alternative to https://reviews.llvm.org/D137601.

xxHash is much faster than djbHash. This makes a simple Rust test case with a large constant string 10% faster to compile.

Previous attempts at changing this hash function (e.g. https://reviews.llvm.org/D97396) had to be reverted due to breaking tests that depended on iteration order.
No additional tests fail with this patch compared to `main` when running `check-all` with `-DLLVM_ENABLE_PROJECTS="all"` (on a Linux host), so I hope I found everything that needs to be changed.

For posterity, the tests that fail on main are:

  ompd-test :: api_tests/test_ompd_finalize.c
  ompd-test :: api_tests/test_ompd_get_curr_parallel_handle.c

Overall:

  Skipped          :     43
  Unsupported      :   2862
  Passed           : 100507
  Expectedly Failed:    296
  Failed           :      2


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142862

Files:
  clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp
  clang-tools-extra/test/modularize/ProblemsDisplayLists.modularize
  clang-tools-extra/test/modularize/ProblemsInconsistent.modularize
  clang/unittests/Basic/SarifTest.cpp
  compiler-rt/test/profile/Linux/instrprof-show-debug-info-correlation.c
  lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py
  llvm/lib/Support/StringMap.cpp
  llvm/test/DebugInfo/Generic/accel-table-hash-collisions.ll
  llvm/test/DebugInfo/Generic/debug-names-hash-collisions.ll
  llvm/test/DebugInfo/X86/debug-pubtables-dwarf64.ll
  llvm/test/DebugInfo/X86/gnu-public-names-gmlt.ll
  llvm/test/DebugInfo/X86/gnu-public-names.ll
  llvm/test/ObjectYAML/Offload/binary.yaml
  llvm/test/ObjectYAML/Offload/multiple_members.yaml
  llvm/test/tools/dsymutil/ARM/extern-alias.test
  llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
  mlir/test/Transforms/print-op-graph.mlir
  mlir/test/mlir-lsp-server/completion.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142862.493188.patch
Type: text/x-patch
Size: 30767 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230130/741cd255/attachment-0001.bin>


More information about the llvm-commits mailing list