aboutsummaryrefslogtreecommitdiff
path: root/lld
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2023-07-20 10:47:47 -0700
committerFangrui Song <i@maskray.me>2023-07-20 10:47:47 -0700
commita3622ac80be1230a96597a4efb8489d065b0ffc2 (patch)
tree1a729c75148bb31d312b90b0216073e3852e6fb9 /lld
parent8e0715e40e43aaadc5a9d3fdd0678e4474fe463b (diff)
downloadllvm-a3622ac80be1230a96597a4efb8489d065b0ffc2.zip
llvm-a3622ac80be1230a96597a4efb8489d065b0ffc2.tar.gz
llvm-a3622ac80be1230a96597a4efb8489d065b0ffc2.tar.bz2
[wasm-ld] Switch to xxh3_64bits
Similar to recent changes to ELF (e.g., D154813), Mach-O, and COFF to improve hashing performance. Reviewed By: dschuff Differential Revision: https://reviews.llvm.org/D155752
Diffstat (limited to 'lld')
-rw-r--r--lld/test/wasm/build-id.test4
-rw-r--r--lld/wasm/InputChunks.cpp2
-rw-r--r--lld/wasm/Writer.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/lld/test/wasm/build-id.test b/lld/test/wasm/build-id.test
index a15f4ce..c5c3cfd 100644
--- a/lld/test/wasm/build-id.test
+++ b/lld/test/wasm/build-id.test
@@ -43,8 +43,8 @@ foo:
# DEFAULT: Contents of section build_id:
-# DEFAULT-NEXT: 0000 10cdbf99 f76b1f5e ebb2f36a 1bde1d6c .....k.^...j...l
-# DEFAULT-NEXT: 0010 01
+# DEFAULT-NEXT: 0000 100e228e 4e2fa853 6393b43d ed1d4676
+# DEFAULT-NEXT: 0010 13 .
# SHA1: Contents of section build_id:
# SHA1-NEXT: 0000 14ad22e8 54d72438 94af85de 3c5592bd ..".T.$8....<U..
diff --git a/lld/wasm/InputChunks.cpp b/lld/wasm/InputChunks.cpp
index a22005f..f55f54a 100644
--- a/lld/wasm/InputChunks.cpp
+++ b/lld/wasm/InputChunks.cpp
@@ -451,7 +451,7 @@ void MergeInputChunk::splitStrings(ArrayRef<uint8_t> data) {
fatal(toString(this) + ": string is not null terminated");
size_t size = end + 1;
- pieces.emplace_back(off, xxHash64(s.substr(0, size)), true);
+ pieces.emplace_back(off, xxh3_64bits(s.substr(0, size)), true);
s = s.substr(size);
off += size;
}
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index 7b33a94..25a9c15 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -290,7 +290,7 @@ void Writer::writeBuildId() {
case BuildIdKind::Fast: {
std::vector<uint8_t> fileHash(8);
computeHash(fileHash, buf, [](uint8_t *dest, ArrayRef<uint8_t> arr) {
- support::endian::write64le(dest, xxHash64(arr));
+ support::endian::write64le(dest, xxh3_64bits(arr));
});
makeUUID(5, fileHash, buildId);
break;