diff options
| author | Chris Lattner <sabre@nondot.org> | 2004-01-18 21:08:52 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2004-01-18 21:08:52 +0000 |
| commit | bc02f4ce97cfde530339c937c879c603a5a10fa7 (patch) | |
| tree | 7933f3d79e77df0dd52ffc6c964180c20cfc0bbc /llvm/lib/Bytecode/Writer/InstructionWriter.cpp | |
| parent | e104d88f83e3fa56cabbb81924d5120bfc86bcbd (diff) | |
| download | bcm5719-llvm-bc02f4ce97cfde530339c937c879c603a5a10fa7.tar.gz bcm5719-llvm-bc02f4ce97cfde530339c937c879c603a5a10fa7.zip | |
Add support for writing bytecode files with compactiontables for bytecode files.
This shrinks the bytecode file for 176.gcc by about 200K (10%), and 254.gap by
about 167K, a 25% reduction. There is still a lot of room for improvement in
the encoding of the compaction table.
llvm-svn: 10915
Diffstat (limited to 'llvm/lib/Bytecode/Writer/InstructionWriter.cpp')
| -rw-r--r-- | llvm/lib/Bytecode/Writer/InstructionWriter.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp index 0bf555d8b55..b93a812d52c 100644 --- a/llvm/lib/Bytecode/Writer/InstructionWriter.cpp +++ b/llvm/lib/Bytecode/Writer/InstructionWriter.cpp @@ -202,7 +202,7 @@ static void outputInstructionFormat3(const Instruction *I, unsigned Opcode, output(Bits, Out); } -void BytecodeWriter::processInstruction(const Instruction &I) { +void BytecodeWriter::outputInstruction(const Instruction &I) { assert(I.getOpcode() < 62 && "Opcode too big???"); unsigned Opcode = I.getOpcode(); @@ -216,9 +216,8 @@ void BytecodeWriter::processInstruction(const Instruction &I) { int MaxOpSlot = 0; int Slots[3]; Slots[0] = (1 << 12)-1; // Marker to signify 0 operands - for (unsigned i = 0; i < NumOperands; ++i) { - const Value *Def = I.getOperand(i); - int slot = Table.getSlot(Def); + for (unsigned i = 0; i != NumOperands; ++i) { + int slot = Table.getSlot(I.getOperand(i)); assert(slot != -1 && "Broken bytecode!"); if (slot > MaxOpSlot) MaxOpSlot = slot; if (i < 3) Slots[i] = slot; |

