[all-commits] [llvm/llvm-project] 9bc655: Mix bits in FileID::getHashValue() (#223794)
Akira Hatanaka via All-commits
all-commits at lists.llvm.org
Thu Sep 17 10:14:54 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9bc655d2852ec31199f2dba25d6f0749953fbe51
https://github.com/llvm/llvm-project/commit/9bc655d2852ec31199f2dba25d6f0749953fbe51
Author: Akira Hatanaka <ahatanak at gmail.com>
Date: 2026-09-17 (Thu, 17 Sep 2026)
Changed paths:
M clang/include/clang/Basic/SourceLocation.h
Log Message:
-----------
Mix bits in FileID::getHashValue() (#223794)
FileID's identity hash was fine under DenseMap's old quadratic probing,
but #200595 switched DenseMap to linear probing with backward-shift
deletion. FileID's bucket index under an identity hash is just its low
bits, so two runs of file IDs can map to the same buckets, which can
turn into a long clustered probe chain under linear probing.
Multiply by 37 to spread the low bits, which matches
SourceLocation::getHashValue(). This fixes a 2.6x compile-time
regression observed with -Wdocumentation on an ObjC++ file.
rdar://187026883
Co-authored-by: Fred Riss <friss at apple.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list