each basic block in function. Instead, just emit a stream of instructions,
chopping up basic blocks based on when we find terminator instructions. This
saves a fairly substantial chunk of bytecode space. In stripped, sample
cases, for example, we get this reduction in size:
197.parser: 163036 -> 137180: 18.8% reduction
254.gap : 844936 -> 689392: 22.6%
255.vortex: 621724 -> 528444: 17.7%
...
Not bad for something this simple. :) Note that this doesn't require a new
bytecode version number at all, though version 1.1 should not need to support
the old format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10280 91177308-0d34-0410-b5e6-96231b3b80d8
* Strength reduce several data structures which were left over from the
"bad old days"
* Minor efficiency improvements
* Major efficiency improvement: In BytecodeParser::insertValue, do not allocate
a new ValueTab entry just because some value exists with a large type. This
dramatically reduces the number of allocations/deallocations performed by the
bytecode reader, and speeds up parsing of Kimwitu++ from 34s to 17s. This is
to help address PR127
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10085 91177308-0d34-0410-b5e6-96231b3b80d8
Correctly parse the Long Filename section of the archive.
When reading in archive members, set their ModuleIDs to
"ARCHIVENAME(MEMBERNAME)", as is traditional.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10043 91177308-0d34-0410-b5e6-96231b3b80d8
constant expression, but is of (for example) ubyte type, then it is a
ConstantUInt. This was not true for placeholders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9994 91177308-0d34-0410-b5e6-96231b3b80d8
* More dense bytecode encoding for varargs calls (like printf)
* Eliminated the extremely old bytecode format. rev #0 is now 1.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9220 91177308-0d34-0410-b5e6-96231b3b80d8
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9190 91177308-0d34-0410-b5e6-96231b3b80d8
For now, we translate linkonce into weak linkage in the bytecode format because
we don't have enough bits to represent it. We will rev the bytecode version
soon anyways, so this will be fixed in the near future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9170 91177308-0d34-0410-b5e6-96231b3b80d8
are ordered by name, not by slot, so the previous solution wasn't any good.
On a large testcase, this reduces time to parse from 2.17s to 1.58s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9002 91177308-0d34-0410-b5e6-96231b3b80d8
changes:
* BytecodeReader::getType(...) used to return a null pointer
on error. This was only checked about half the time. Now we convert
it to throw an exception, and delete the half that checked for error.
This was checked in before, but psmith crashed and lost the change :(
* insertValue no longer returns -1 on error, so callers don't need to
check for it.
* Substantial rewrite of InstructionReader.cpp, to use more efficient,
simpler, data structures. This provides another 5% speedup. This also
makes the code much easier to read and understand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8984 91177308-0d34-0410-b5e6-96231b3b80d8
simplifies the control flow a bit. This provides a small (~3%) speedup,
but it's primarily a cleanup exercise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8983 91177308-0d34-0410-b5e6-96231b3b80d8