diff options
| author | Devang Patel <dpatel@apple.com> | 2010-06-02 23:05:04 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2010-06-02 23:05:04 +0000 |
| commit | 63b11baa5f0735e5bc2cfc5a93f8e5b3bc3caad8 (patch) | |
| tree | 834ba2acc95eeea1ba39031a2c266569ca8ade0a /lib/Bitcode/Writer/ValueEnumerator.h | |
| parent | 529a9497d20172f52db11116aae0cd2c5e030c31 (diff) | |
| download | external_llvm-63b11baa5f0735e5bc2cfc5a93f8e5b3bc3caad8.zip external_llvm-63b11baa5f0735e5bc2cfc5a93f8e5b3bc3caad8.tar.gz external_llvm-63b11baa5f0735e5bc2cfc5a93f8e5b3bc3caad8.tar.bz2 | |
Speedup bitcode writer. Do not walk all values for all functions to emit function local metadata. In one testcase, probably worst case scenario, the 70x speed up is seen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.h')
| -rw-r--r-- | lib/Bitcode/Writer/ValueEnumerator.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.h b/lib/Bitcode/Writer/ValueEnumerator.h index 4f8ebf5..2b9b15f 100644 --- a/lib/Bitcode/Writer/ValueEnumerator.h +++ b/lib/Bitcode/Writer/ValueEnumerator.h @@ -15,6 +15,7 @@ #define VALUE_ENUMERATOR_H #include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Attributes.h" #include <vector> @@ -26,7 +27,7 @@ class Instruction; class BasicBlock; class Function; class Module; -class MetadataBase; +class MDNode; class NamedMDNode; class AttrListPtr; class TypeSymbolTable; @@ -49,6 +50,7 @@ private: ValueMapType ValueMap; ValueList Values; ValueList MDValues; + SmallVector<const MDNode *, 8> FunctionLocalMDs; ValueMapType MDValueMap; typedef DenseMap<void*, unsigned> AttributeMapType; @@ -105,6 +107,9 @@ public: const ValueList &getValues() const { return Values; } const ValueList &getMDValues() const { return MDValues; } + const SmallVector<const MDNode *, 8> &getFunctionLocalMDValues() const { + return FunctionLocalMDs; + } const TypeList &getTypes() const { return Types; } const std::vector<const BasicBlock*> &getBasicBlocks() const { return BasicBlocks; |
