summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/ValueEnumerator.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-06-02 23:05:04 +0000
committerDevang Patel <dpatel@apple.com>2010-06-02 23:05:04 +0000
commitdf84e8baf7e303e8246460cb0b9d2c00e98d26c6 (patch)
treef0f1358f342448dc162a079f6a80be6e31cddb3e /llvm/lib/Bitcode/Writer/ValueEnumerator.h
parent7ee730eb40a4e4a3e32a4da555b3b5f8bb6f676a (diff)
downloadbcm5719-llvm-df84e8baf7e303e8246460cb0b9d2c00e98d26c6.tar.gz
bcm5719-llvm-df84e8baf7e303e8246460cb0b9d2c00e98d26c6.zip
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.
llvm-svn: 105360
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.h')
-rw-r--r--llvm/lib/Bitcode/Writer/ValueEnumerator.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.h b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
index 4f8ebf55e19..2b9b15fa5a7 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/llvm/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;
OpenPOWER on IntegriCloud