llvm-6502/lib
Benjamin Kramer 611afc0620 Cache the hash value of the operands in the MDNode.
FoldingSet is implemented as a chained hash table. When there is a hash
collision during insertion, which is common as we fill the table until a
load factor of 2.0 is hit, we walk the chained elements, comparing every
operand with the new element's operands. This can be very expensive if the
MDNode has many operands.

We sacrifice a word of space in MDNode to cache the full hash value, reducing
compares on collision to a minimum. MDNode grows from 28 to 32 bytes + operands
on x86. On x86_64 the new bits fit nicely into existing padding, not growing
the struct at all.

The actual speedup depends a lot on the test case and is typically between
1% and 2% for C++ code with clang -c -O0 -g.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154497 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-11 14:06:54 +00:00
..
Analysis Add two statistics to help track how we are computing the inline cost. 2012-04-11 10:15:10 +00:00
Archive Include cstdio in a few place that depended on getting it transitively through StringExtras.h 2012-03-23 11:35:30 +00:00
AsmParser Convert assert(0) to llvm_unreachable 2012-02-07 05:05:23 +00:00
Bitcode llvm::SwitchInst 2012-03-11 06:09:17 +00:00
CodeGen Reapply 154397. Original message: 2012-04-11 08:26:11 +00:00
DebugInfo Fix a C++11 UDL conflict. 2012-04-04 20:33:56 +00:00
ExecutionEngine EngineBuilder::create is expected to take ownership of the TargetMachine passed to it. Delete it on error or when we create an interpreter that doesn't need it. 2012-04-08 14:53:14 +00:00
Linker It's possible for two types, which are isomorphic, to be added to the 2012-03-23 23:17:38 +00:00
MC Compute hashes directly with hash_combine instead of taking a detour through FoldingSetNodeID. 2012-04-11 14:06:39 +00:00
Object Add a constructor for DataRefImpl and remove excess initialization. 2012-04-10 01:54:44 +00:00
Support FoldingSet: Push the hash through FoldingSetTraits::Equals, so clients can use it. 2012-04-11 14:06:47 +00:00
TableGen Fix infinite loop in nested multiclasses. 2012-03-07 16:39:35 +00:00
Target remove unused argument 2012-04-11 11:05:21 +00:00
Transforms Add two statistics to help track how we are computing the inline cost. 2012-04-11 10:15:10 +00:00
VMCore Cache the hash value of the operands in the MDNode. 2012-04-11 14:06:54 +00:00
CMakeLists.txt Move TableGen's parser and entry point into a library 2011-10-01 16:41:13 +00:00
LLVMBuild.txt LLVMBuild: Introduce a common section which currently has a list of the 2011-12-12 22:45:54 +00:00
Makefile Remove more of llvmc and dependencies. 2011-09-20 00:34:27 +00:00