[PATCH] D16571: Compute the DISubprogram hash key partially (NFC)

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 01:23:24 PST 2016

joker.eph created this revision.
joker.eph added a reviewer: dexonsmith.
joker.eph added a subscriber: llvm-commits.

This patch changes the computation of the hash key for DISubprogram to
be computed on a small subset of the fields. The hash is computed a
lot faster, but there might be more collision in the table.
However by carefully selecting the fields, colisions should be rare.

Using `opt` to load the IR for FastISelEmitter.cpp.o, this patch
improves DISubprogram::getImpl() runtime from 28ms to 15ms.



Index: lib/IR/LLVMContextImpl.h
--- lib/IR/LLVMContextImpl.h
+++ lib/IR/LLVMContextImpl.h
@@ -519,10 +519,7 @@
            Variables == RHS->getRawVariables();
   unsigned getHashValue() const {
-    return hash_combine(Scope, Name, LinkageName, File, Line, Type,
-                        IsLocalToUnit, IsDefinition, ScopeLine, ContainingType,
-                        Virtuality, VirtualIndex, Flags, IsOptimized,
-                        TemplateParams, Declaration, Variables);
+    return hash_combine(Scope, File, Type, Line);

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16571.45953.patch
Type: text/x-patch
Size: 617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160126/de820457/attachment.bin>

More information about the llvm-commits mailing list