aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/LLVMContextImpl.h
diff options
context:
space:
mode:
authorMichael Ilseman <milseman@apple.com>2013-03-01 18:48:54 +0000
committerMichael Ilseman <milseman@apple.com>2013-03-01 18:48:54 +0000
commit4c8e74f0b75cb10820c45c86399fbd02e4a8832a (patch)
treecc1f1cdb45bee8daff09970eaa0d992d952b6edf /lib/IR/LLVMContextImpl.h
parenta6b20ced765b67a85d9219d0c8547fc9c133e14f (diff)
downloadexternal_llvm-4c8e74f0b75cb10820c45c86399fbd02e4a8832a.zip
external_llvm-4c8e74f0b75cb10820c45c86399fbd02e4a8832a.tar.gz
external_llvm-4c8e74f0b75cb10820c45c86399fbd02e4a8832a.tar.bz2
Cache the result of Function::getIntrinsicID() in a DenseMap attached to the LLVMContext.
This reduces the time actually spent doing string to ID conversion and shows a 10% improvement in compile time for a particularly bad case that involves ARM Neon intrinsics (these have many overloads). Patch by Jean-Luc Duprat! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/LLVMContextImpl.h')
-rw-r--r--lib/IR/LLVMContextImpl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/IR/LLVMContextImpl.h b/lib/IR/LLVMContextImpl.h
index 7353dc0..0c659b8 100644
--- a/lib/IR/LLVMContextImpl.h
+++ b/lib/IR/LLVMContextImpl.h
@@ -318,7 +318,7 @@ public:
/// ValueHandles - This map keeps track of all of the value handles that are
/// watching a Value*. The Value::HasValueHandle bit is used to know
- // whether or not a value has an entry in this map.
+ /// whether or not a value has an entry in this map.
typedef DenseMap<Value*, ValueHandleBase*> ValueHandlesTy;
ValueHandlesTy ValueHandles;
@@ -350,6 +350,11 @@ public:
/// to date.
std::vector<std::pair<DebugRecVH, DebugRecVH> > ScopeInlinedAtRecords;
+ /// IntrinsicIDCache - Cache of intrinsic name (string) to numeric ID mappings
+ /// requested in this context
+ typedef DenseMap<const Function*, unsigned> IntrinsicIDCacheTy;
+ IntrinsicIDCacheTy IntrinsicIDCache;
+
int getOrAddScopeRecordIdxEntry(MDNode *N, int ExistingIdx);
int getOrAddScopeInlinedAtIdxEntry(MDNode *Scope, MDNode *IA,int ExistingIdx);