summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-03-19 00:59:26 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-03-19 00:59:26 +0000
commit53fc3895e0c5c6a25951d980ca236e23a7cffe3d (patch)
tree00cda545bacb45db2cc46fece0e68c6f19f50181 /llvm
parentd23be3d30d808c4c0d9a6cbd98274ec49afef7a9 (diff)
downloadbcm5719-llvm-53fc3895e0c5c6a25951d980ca236e23a7cffe3d.tar.gz
bcm5719-llvm-53fc3895e0c5c6a25951d980ca236e23a7cffe3d.zip
Compute some Debug Info Metadata hash key partially (NFC)
Summary: 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, with this patch: - DISubprogram::getImpl() goes from 28ms to 15ms. - DICompositeType::getImpl() goes from 6ms to 2ms - DIDerivedType::getImpl() goes from 18 to 12ms Reviewers: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16571 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263866
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/IR/LLVMContextImpl.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index 019e2d07e15..6d294e77861 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -365,8 +365,7 @@ template <> struct MDNodeKeyImpl<DIDerivedType> {
ExtraData == RHS->getRawExtraData();
}
unsigned getHashValue() const {
- return hash_combine(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
- AlignInBits, OffsetInBits, Flags, ExtraData);
+ return hash_combine(Tag, Name, File, Line, Scope, BaseType, Flags);
}
};
@@ -422,9 +421,8 @@ template <> struct MDNodeKeyImpl<DICompositeType> {
Identifier == RHS->getIdentifier();
}
unsigned getHashValue() const {
- return hash_combine(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
- AlignInBits, OffsetInBits, Flags, Elements, RuntimeLang,
- VTableHolder, TemplateParams, Identifier);
+ return hash_combine(Name, File, Line, BaseType, Scope, Elements,
+ TemplateParams);
}
};
@@ -518,10 +516,7 @@ template <> struct MDNodeKeyImpl<DISubprogram> {
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(Name, Scope, File, Type, Line);
}
};
OpenPOWER on IntegriCloud