aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-09 07:51:47 +0000
committerChris Lattner <sabre@nondot.org>2007-02-09 07:51:47 +0000
commitba6de4b1cf6057f9b62d785b2e8e70a469ce25d7 (patch)
tree9587263a7801f90a570ca20852f5e890fa7482ac /lib/Bytecode
parentff4304f8243f55e2e5c63bc95517cd38ff9295e1 (diff)
1. constants can never occur in the symbol table.
2. All function-level constants are now incorporated into the module-level constant pool, since the compaction table was removed. Eliminate extra work to check for them. This speeds up the bcwriter from 24.4s to 13.1s on 447.dealII and .73 -> .56s on kc++ in a release build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Writer/SlotCalculator.cpp18
-rw-r--r--lib/Bytecode/Writer/SlotCalculator.h1
-rw-r--r--lib/Bytecode/Writer/Writer.cpp2
3 files changed, 0 insertions, 21 deletions
diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp
index 197f20601a..478216d145 100644
--- a/lib/Bytecode/Writer/SlotCalculator.cpp
+++ b/lib/Bytecode/Writer/SlotCalculator.cpp
@@ -171,7 +171,6 @@ void SlotCalculator::processModule() {
}
getOrCreateSlot(I->getType());
}
- processSymbolTableConstants(&F->getValueSymbolTable());
}
// Insert constants that are named at module level into the slot pool so that
@@ -233,15 +232,6 @@ void SlotCalculator::processValueSymbolTable(const ValueSymbolTable *VST) {
getOrCreateSlot(VI->second);
}
-void SlotCalculator::processSymbolTableConstants(const ValueSymbolTable *VST) {
- // Now do the constant values in all planes
- for (ValueSymbolTable::const_iterator VI = VST->begin(), VE = VST->end();
- VI != VE; ++VI)
- if (isa<Constant>(VI->second) && !isa<GlobalValue>(VI->second))
- getOrCreateSlot(VI->second);
-}
-
-
void SlotCalculator::incorporateFunction(const Function *F) {
assert((ModuleLevel.empty() ||
ModuleTypeLevel == 0) && "Module already incorporated!");
@@ -270,14 +260,6 @@ void SlotCalculator::incorporateFunction(const Function *F) {
for (constant_iterator CI = constant_begin(F), CE = constant_end(F);
CI != CE; ++CI)
getOrCreateSlot(*CI);
-
- // If there is a symbol table, it is possible that the user has names for
- // constants that are not being used. In this case, we will have problems
- // if we don't emit the constants now, because otherwise we will get
- // symbol table references to constants not in the output. Scan for these
- // constants now.
- //
- processSymbolTableConstants(&F->getValueSymbolTable());
}
SC_DEBUG("Inserting Instructions:\n");
diff --git a/lib/Bytecode/Writer/SlotCalculator.h b/lib/Bytecode/Writer/SlotCalculator.h
index 6cddb30f99..353a97a1d1 100644
--- a/lib/Bytecode/Writer/SlotCalculator.h
+++ b/lib/Bytecode/Writer/SlotCalculator.h
@@ -132,7 +132,6 @@ private:
//
void processTypeSymbolTable(const TypeSymbolTable *ST);
void processValueSymbolTable(const ValueSymbolTable *ST);
- void processSymbolTableConstants(const ValueSymbolTable *ST);
// insertPrimitives - helper for constructors to insert primitive types.
void insertPrimitives();
diff --git a/lib/Bytecode/Writer/Writer.cpp b/lib/Bytecode/Writer/Writer.cpp
index a2e8fe566d..a7d4b005ab 100644
--- a/lib/Bytecode/Writer/Writer.cpp
+++ b/lib/Bytecode/Writer/Writer.cpp
@@ -1112,8 +1112,6 @@ void BytecodeWriter::outputFunction(const Function *F) {
// Get slot information about the function...
Table.incorporateFunction(F);
- outputConstants(true);
-
// Output all of the instructions in the body of the function
outputInstructions(F);