[llvm] [Support] Add SipHash-based 64-bit stable hash function (PR #160945)

Marco Elver via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 01:25:10 PDT 2025


melver wrote:

> Have you verified arm64e tests are unaffected? In principle codegen should be fine due to truncation, but there's a builtin (`__builtin_ptrauth_string_discriminator`) which may fail

This should be a non-functional change for getPointerAuthStableSipHash() - I just factored out part of it into a separate function that we now expose:
```
-  uint64_t RawHash = endian::read64le(RawHashBytes);
+  return endian::read64le(RawHashBytes);
+}
+
+/// Compute an ABI-stable 16-bit hash of the given string.
+uint16_t llvm::getPointerAuthStableSipHash(StringRef Str) {
+  uint64_t RawHash = getStableSipHash(Str);
```

Did I miss something?

https://github.com/llvm/llvm-project/pull/160945


More information about the llvm-commits mailing list