[llvm] [DebugInfo] Pack DILocation hash inputs (PR #196556)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri May 8 08:54:30 PDT 2026
================
@@ -347,9 +349,9 @@ template <> struct MDNodeKeyImpl<DILocation> {
// outweighed by the overall compile time savings by performing this check.
// * (hash_combine(x) != hash_combine(x, 0))
if (AtomGroup || AtomRank)
- return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode,
- AtomGroup, (uint8_t)AtomRank);
- return hash_combine(Line, Column, Scope, InlinedAt, ImplicitCode);
+ return hash_combine(LineColumnAndImplicitCode, Scope, InlinedAt,
+ (AtomGroup << 3) | AtomRank);
----------------
nikic wrote:
Inverting this is slightly more efficient because it matches the memory layout: https://clang.godbolt.org/z/qcfqv13T7
https://github.com/llvm/llvm-project/pull/196556
More information about the llvm-commits
mailing list