aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Writer/SlotCalculator.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-01-30 19:36:46 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-01-30 19:36:46 +0000
commitd2bb887cd193b8b47fb15fedc7a05ab66997d4c5 (patch)
tree6efd9c6a02e765929fc4d7ca6d337b5d9c9187f8 /lib/Bytecode/Writer/SlotCalculator.h
parent908504347b0565c4d4817af444012be76ba4b76f (diff)
Bye, Bye Compaction Tables. The benefit compaction tables provides doesn't
outweight its computational costs. This patch removes all compaction table handling from the bcreader and bcwriter. For the record, here's the difference betweeen having and not having compaction tables for some tests: Test With Without Size Chg Olden/mst 5,602 5,598 +0.1% viterbi 18,026 17,795 +1.3% obsequi 162,133 166,663 -2.8% burg 224,090 228,148 -1.8% kimwitu++ 4,933,263 5,121,159 -3.8% 176.gcc 8,470,424 9,141,539 -7.3% It seems that it is more beneficial to larger files, but even on the largest test case we have (176.gcc) it only amounts ot an I/O saving of 7.3%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33661 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/SlotCalculator.h')
-rw-r--r--lib/Bytecode/Writer/SlotCalculator.h51
1 files changed, 3 insertions, 48 deletions
diff --git a/lib/Bytecode/Writer/SlotCalculator.h b/lib/Bytecode/Writer/SlotCalculator.h
index de91d2e8f5..820099273b 100644
--- a/lib/Bytecode/Writer/SlotCalculator.h
+++ b/lib/Bytecode/Writer/SlotCalculator.h
@@ -61,17 +61,6 @@ class SlotCalculator {
/// is only possible if building information for a bytecode file.
bool ModuleContainsAllFunctionConstants;
- /// CompactionTable/NodeMap - When function compaction has been performed,
- /// these entries provide a compacted view of the namespace needed to emit
- /// instructions in a function body. The 'getSlot()' method automatically
- /// returns these entries if applicable, or the global entries if not.
- std::vector<TypePlane> CompactionTable;
- TypeList CompactionTypes;
- typedef std::map<const Value*, unsigned> CompactionNodeMapType;
- CompactionNodeMapType CompactionNodeMap;
- typedef std::map<const Type*, unsigned> CompactionTypeMapType;
- CompactionTypeMapType CompactionTypeMap;
-
SlotCalculator(const SlotCalculator &); // DO NOT IMPLEMENT
void operator=(const SlotCalculator &); // DO NOT IMPLEMENT
public:
@@ -85,24 +74,8 @@ public:
int getSlot(const Value *V) const;
int getSlot(const Type* T) const;
- /// getGlobalSlot - Return a slot number from the global table. This can only
- /// be used when a compaction table is active.
- unsigned getGlobalSlot(const Value *V) const;
- unsigned getGlobalSlot(const Type *V) const;
-
- inline unsigned getNumPlanes() const {
- if (CompactionTable.empty())
- return Table.size();
- else
- return CompactionTable.size();
- }
-
- inline unsigned getNumTypes() const {
- if (CompactionTypes.empty())
- return Types.size();
- else
- return CompactionTypes.size();
- }
+ inline unsigned getNumPlanes() const { return Table.size(); }
+ inline unsigned getNumTypes() const { return Types.size(); }
inline unsigned getModuleLevel(unsigned Plane) const {
return Plane < ModuleLevel.size() ? ModuleLevel[Plane] : 0;
@@ -114,11 +87,7 @@ public:
}
TypePlane &getPlane(unsigned Plane);
- TypeList& getTypes() {
- if (!CompactionTypes.empty())
- return CompactionTypes;
- return Types;
- }
+ TypeList& getTypes() { return Types; }
/// incorporateFunction/purgeFunction - If you'd like to deal with a function,
/// use these two methods to get its data into the SlotCalculator!
@@ -133,15 +102,6 @@ public:
string_iterator string_begin() const { return ConstantStrings.begin(); }
string_iterator string_end() const { return ConstantStrings.end(); }
- const std::vector<TypePlane> &getCompactionTable() const {
- return CompactionTable;
- }
-
- const TypeList& getCompactionTypes() const { return CompactionTypes; }
-
- /// @brief Determine if the compaction table (not types) is empty
- bool CompactionTableIsEmpty() const;
-
private:
// getOrCreateSlot - Values can be crammed into here at will... if
// they haven't been inserted already, they get inserted, otherwise
@@ -173,11 +133,6 @@ private:
void processValueSymbolTable(const SymbolTable *ST);
void processSymbolTableConstants(const SymbolTable *ST);
- void buildCompactionTable(const Function *F);
- unsigned getOrCreateCompactionTableSlot(const Value *V);
- unsigned getOrCreateCompactionTableSlot(const Type *V);
- void pruneCompactionTable();
-
// insertPrimitives - helper for constructors to insert primitive types.
void insertPrimitives();
};