Change the table datastructure to be a vector<smallvector>, instead of

vector<vector> to avoid allocations.  This speeds up bcwriting of 447.dealII
from 0.8276 to 0.7637s (8.4%).

This concludes this round of proding the bcwriter into submission.  Final
speedup from 24.4s to 0.7637s (32x).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34142 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2007-02-10 07:42:59 +00:00
parent ae052aa5a7
commit 863da4c4f5
3 changed files with 14 additions and 16 deletions

View File

@@ -21,6 +21,7 @@
#define LLVM_ANALYSIS_SLOTCALCULATOR_H
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallVector.h"
#include <vector>
namespace llvm {
@@ -44,9 +45,10 @@ struct ModuleLevelDenseMapKeyInfo {
class SlotCalculator {
const Module *TheModule;
public:
typedef std::vector<const Type*> TypeList;
typedef std::vector<const Value*> TypePlane;
typedef SmallVector<const Value*, 16> TypePlane;
private:
std::vector<TypePlane> Table;
TypeList Types;
typedef DenseMap<const Value*, unsigned> NodeMapType;