From ec39f095f5abaf1ec90d7c6c46454032cda36e1c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 30 Mar 2010 23:03:27 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99957 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/LLVMContext.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/llvm/LLVMContext.h') diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 6d36d5eb1e..ea7f4a2d8e 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -36,6 +36,12 @@ public: LLVMContext(); ~LLVMContext(); + // Pinned metadata names, which always have the same value. This is a + // compile-time performance optimization, not a correctness optimization. + enum { + MD_dbg = 1 // "dbg" -> 1. + }; + /// getMDKindID - Return a unique non-zero ID for the specified metadata kind. /// This ID is uniqued across modules in the current LLVMContext. unsigned getMDKindID(StringRef Name) const; -- cgit v1.2.3