Commit Graph

72 Commits

Author SHA1 Message Date
Reid Spencer
5ac8812c54 Adjust to new Module.h interface for dependent libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15218 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:32:02 +00:00
Reid Spencer
ad89bd6a1a bug 263:
- encode/decode target triple and dependent libraries
bug 401:
- fix encoding/decoding of FP values to be little-endian only
bug 402:
- initial (compatible) cut at 24-bit types instead of 32-bit
- reduce size of block headers by 50%
Other:
- cleanup Writer by consolidating to one compilation unit, rem. other files
- use a std::vector instead of std::deque so the buffer can be allocated
  in multiples of 64KByte chunks rather than in multiples of some smaller
  (default) number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15210 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:07:36 +00:00
Reid Spencer
e0125b6785 bug 122:
- Correct ordering of tests because for GlobalValue isa Constant


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14941 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:16:21 +00:00
Reid Spencer
0852c80e38 Remove Tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14611 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:46:15 +00:00
Reid Spencer
cb3595c3d1 Implement new output functions for types and compacted type planes. Also
remove use of Type::TypeTyID and Type::TypeTy since Type no longer inherits
Value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14610 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:45:47 +00:00
Chris Lattner
036de03128 No functionality changes here:
* Some warning fixes for MSVC
  * Minor simplification to the deque scanning code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14417 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 20:52:10 +00:00
Chris Lattner
d61622857f Fix more warnings building with VC++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14391 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 00:35:55 +00:00
Reid Spencer
6ed81e253c Use the SymbolTable::isEmpty() method instead of checking for no value
planes. A SymbolTable could still have types in it! This fixes problems
with two regression tests that failed because a symbol table that only
contained types was being omitted from bytecode files. Thanks to Chris
for the reduced test case that helped find this immediately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13842 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-27 20:18:51 +00:00
Reid Spencer
798ff64328 Part of bug 122:
This change removes the BuildBytecodeInfo flag from the SlotCalculator
class. This flag was needed to distinguish between the Bytecode/Writer
and the AsmWriter. Now that AsmWriter doesn't use SlotCalculator, we can
remove this flag and simplify some code. Also, some minor name changes
to CachedWriter.h needed to be committed (missed in previous commit).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13785 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-26 07:37:11 +00:00
Reid Spencer
94f2df295d Changed to use SymbolTable's new iteration interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13759 91177308-0d34-0410-b5e6-96231b3b80d8
2004-05-25 17:29:59 +00:00
Chris Lattner
5fa428fda9 Implement support for a new LLVM 1.3 bytecode format, which uses uint's
to index into structure types and allows arbitrary 32- and 64-bit integer
types to index into sequential types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12651 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-05 01:27:26 +00:00
Chris Lattner
fff663b47a Remove all of the annoying statistics now that I'm finished (for the near
term) working on bytecode size stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11046 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-01 01:50:31 +00:00
Chris Lattner
52f86d6247 Bugfixes for dealing with partially compactified functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10920 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 00:54:06 +00:00
Chris Lattner
241024381f Save another 30K from 176.gcc by encoding the compaction table a bit more
intelligently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10918 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 22:35:34 +00:00
Chris Lattner
33522d4f25 Remove -debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10917 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 22:26:53 +00:00
Chris Lattner
cf3e67f70a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10915 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:08:52 +00:00
Chris Lattner
80b97343ec Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
type planes.  This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10908 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-17 23:25:43 +00:00
Chris Lattner
0baa0af861 If these blocks are empty, there is no reason to even emit the bytecode blocks.
This saves about 15K in 176.gcc, coupled with another patch that I'm working on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10889 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 21:06:57 +00:00
Chris Lattner
f4c0e7f587 Fix PR73: bytecode format inconsistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10876 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 17:55:09 +00:00
Chris Lattner
83bb3d2f4e The new bytecode format supports emitting strings a special case. This is
intended to save size (and does on small programs), but on big programs it
actually increases the size of the program slightly.  The deal is that many
functions end up using the characters that the string contained, and the
characters are no longer in the global constant table, so they have to be
emitted in function specific constant pools.

This pessimization will be fixed in subsequent patches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10864 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:36:54 +00:00
Chris Lattner
d6942d7633 Ok, I can't handle it. This is a temporary checkin of a ton of statistics that
i'm using in my work to reduce the bytecode file sizes.  These will eventually
be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10849 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 16:54:21 +00:00
Chris Lattner
277bafbff7 Toggle sense of flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10838 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 02:50:16 +00:00
Chris Lattner
737d3cd719 Do not bother to emit a BytecodeBlock for an empty symbol table. This commonly
occurs when the symbol table for a module has been stripped, making all of the
function local symbols go away.

This saves 6728 bytes in the stripped bytecode file of 254.gap (which obviously
has 841 functions), which isn't a ton, but helps and was easy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10750 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:56:59 +00:00
Chris Lattner
32abce6e3a Err, we don't need Config/*.h files for things that are standard C++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10742 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:10:01 +00:00
Chris Lattner
1499934c64 minor comment tweaks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10741 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:07:06 +00:00
Chris Lattner
44f549b4eb Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10737 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 18:49:43 +00:00
Chris Lattner
8d1dbd2134 Emit & read more compressed bytecode by not emitting a bytecodeblock for
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
2003-12-01 07:05:31 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
22482a14be add support for new linkage types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9228 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 06:30:21 +00:00
Chris Lattner
eff112c6c3 Updated to emit the final 1.0 bytecode format. This supports weak linkage,
more efficient encoding of varargs calls, and the new varargs intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9221 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:54:48 +00:00
Alkis Evlogimenos
60596382aa Eliminate some extraneous code in SlotCalculator::insertVal().
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
2003-10-17 02:02:40 +00:00
Chris Lattner
6b25242a4b Add support for 'weak' linkage.
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
2003-10-16 18:28:50 +00:00
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Chris Lattner
abe83ae992 Fix a spello Misha made while fixing one of my appostrifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8510 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-15 00:33:20 +00:00
Misha Brukman
37f92e2568 Fixed spelling and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8489 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 22:34:13 +00:00
Chris Lattner
d445c6b64a Allow modules to have 'any' pointer size and endianness. Luckily, we had
some space for extra flags, so we don't need to bump the revision number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8118 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 13:47:36 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Chris Lattner
f69315bd79 Fix bug: Assembler/2003-05-03-BytecodeReaderProblem.llx
by emitting the type planes before any constants (which could be constant
expressions involving undefined types!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6285 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 18:35:38 +00:00
Chris Lattner
76e3896881 Add support for reading and writing pointersize/endianness to and from bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5839 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 18:15:10 +00:00
Chris Lattner
e3869c83e7 Add support to the bytecode reader/writer for the new linkage types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5790 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 21:16:05 +00:00
Chris Lattner
186a1f71e6 Changes to the V2 bytecode format:
- Null values are implicitly encoded instead of explicitly, this makes
    things more compact!
  - More compactly represent ConstantPointerRefs
  - Bytecode files are represented as:
      Header|GlobalTypes|GlobalVars/Function Protos|Constants|Functions|SymTab
    instead of
      Header|GlobalTypes|Constants|GlobalVars/Function Protos|Functions|SymTab
    which makes a lot of things simpler.

Writer changes:
  - We now explictly encode versioning information in the bytecode files.
  - This allows new code to read bytecode files produced by old code, but
    new bytecode files can have enhancements such as the above.  Although this
    makes the reader a bit more complex (having to deal with old formats), the
    writer only needs to be able to produce the most recent version.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5749 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-19 20:56:46 +00:00
Chris Lattner
6e6026b465 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 18:36:02 +00:00
Chris Lattner
6463e0df85 Clean up code a bit, no functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4162 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 03:34:17 +00:00
Chris Lattner
a92f696b74 Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:38:41 +00:00
Chris Lattner
ce6ef112c4 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3105 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 18:40:14 +00:00
Chris Lattner
635cd9347e Register the WriteBytecodePass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3033 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 19:56:44 +00:00
Vikram S. Adve
a7dac3db79 Write out the plane for types first, since values of primitive types
may be constructed by expressions of other types (and so the
contents of the primitive type planes must come after all types).
Use a helper function outputConstantsInPlane in outputConstants to
do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2898 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:07:51 +00:00
Anand Shukla
eea60fc59c changes to make it compatible with 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2790 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 20:44:04 +00:00
Chris Lattner
0b12b5f50e MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2778 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:21 +00:00