Do a topological sort of the types before writing them out.

This takes the linking of libxul on linux from 6m54.931s to 5m39.840s.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129009 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola
2011-04-06 16:49:37 +00:00
parent 714b34fc24
commit f5a90561b0
3 changed files with 71 additions and 29 deletions
+2 -2
View File
@@ -36,8 +36,7 @@ class MDSymbolTable;
class ValueEnumerator {
public:
// For each type, we remember its Type* and occurrence frequency.
typedef std::vector<std::pair<const Type*, unsigned> > TypeList;
typedef std::vector<const Type*> TypeList;
// For each value, we remember its Value* and occurrence frequency.
typedef std::vector<std::pair<const Value*, unsigned> > ValueList;
@@ -136,6 +135,7 @@ public:
private:
void OptimizeConstants(unsigned CstStart, unsigned CstEnd);
void OptimizeTypes();
void EnumerateMDNodeOperands(const MDNode *N);
void EnumerateMetadata(const Value *MD);