summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/LLVMContext.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-30 23:03:27 +0000
committerChris Lattner <sabre@nondot.org>2010-03-30 23:03:27 +0000
commitc263b42d0d9aeeacfe426291fcb151427e73144e (patch)
treef99887a3fda78a6ab11661b029000584f03cf402 /llvm/lib/VMCore/LLVMContext.cpp
parent6f6ebb663c1cef9f3e7e35118b7731bd02bfbd3e (diff)
downloadbcm5719-llvm-c263b42d0d9aeeacfe426291fcb151427e73144e.tar.gz
bcm5719-llvm-c263b42d0d9aeeacfe426291fcb151427e73144e.zip
Fix a major source of compile-time slowness at -O0 -g by optimizing
the storage of !dbg metadata kinds in the instruction themselves. The on-the-side hash table works great for metadata that not-all instructions get, or for metadata that only exists when optimizing. But when compile-time is everything, it isn't great. I'm not super thrilled with the fact that this plops a TrackingVH in Instruction, because it grows it by 3 words. I'm investigating alternatives, but this should be a step in the right direction in any case. llvm-svn: 99957
Diffstat (limited to 'llvm/lib/VMCore/LLVMContext.cpp')
-rw-r--r--llvm/lib/VMCore/LLVMContext.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/LLVMContext.cpp b/llvm/lib/VMCore/LLVMContext.cpp
index f9d3fe0021d..2a870ec6cfd 100644
--- a/llvm/lib/VMCore/LLVMContext.cpp
+++ b/llvm/lib/VMCore/LLVMContext.cpp
@@ -26,7 +26,11 @@ LLVMContext& llvm::getGlobalContext() {
return *GlobalContext;
}
-LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) { }
+LLVMContext::LLVMContext() : pImpl(new LLVMContextImpl(*this)) {
+ // Create the first metadata kind, which is always 'dbg'.
+ unsigned DbgID = getMDKindID("dbg");
+ assert(DbgID == MD_dbg && "dbg kind id drifted"); (void)DbgID;
+}
LLVMContext::~LLVMContext() { delete pImpl; }
OpenPOWER on IntegriCloud