Commit Graph

107 Commits

Author SHA1 Message Date
Chris Lattner ac6db755c3 Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner fa829be4d3 Start using the new and improve interface to FunctionType arguments
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner 8c285b20b7 Remove all of the annoying statistics now that I'm finished (for the near
term) working on bytecode size stuff.

llvm-svn: 11046
2004-02-01 01:50:31 +00:00
Chris Lattner c70b3f63cc SlotCalculator.h moved
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner a395324383 Bugfixes for dealing with partially compactified functions
llvm-svn: 10920
2004-01-20 00:54:06 +00:00
Chris Lattner 5a66bb7507 Save another 30K from 176.gcc by encoding the compaction table a bit more
intelligently.

llvm-svn: 10918
2004-01-18 22:35:34 +00:00
Chris Lattner 979ca2fccd Remove -debug output
llvm-svn: 10917
2004-01-18 22:26:53 +00:00
Chris Lattner bc02f4ce97 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
2004-01-18 21:08:52 +00:00
Chris Lattner 677af4a1cb 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.

llvm-svn: 10908
2004-01-17 23:25:43 +00:00
Chris Lattner 4c57267ece 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.

llvm-svn: 10889
2004-01-15 21:06:57 +00:00
Chris Lattner f4572852dc ConstantPointerRef's are no longer emitted. This saves 20028 bytes in the
bytecode files when compiling 176.gcc, but more importantly will make it
easier to eliminate CPR's in the future (no new .bc revision will be
required to support them)

llvm-svn: 10884
2004-01-15 18:46:56 +00:00
Chris Lattner 394fc96f39 Fix PR73: bytecode format inconsistent
llvm-svn: 10876
2004-01-15 17:55:09 +00:00
Chris Lattner 1af644d9d6 Remove the optimization that depends on ENDIAN_LITTLE: it's not worth it.
llvm-svn: 10870
2004-01-15 06:11:30 +00:00
Chris Lattner 6229fbf328 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.

llvm-svn: 10864
2004-01-14 23:36:54 +00:00
Chris Lattner eeb4ffd8ea It is obvious that this has never been used for outputing more than a single
byte, it's totally endian incorrect!

llvm-svn: 10857
2004-01-14 18:50:28 +00:00
Chris Lattner 29f9590e82 Be const correct
llvm-svn: 10856
2004-01-14 18:41:38 +00:00
Chris Lattner 9a38c78fe6 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.

llvm-svn: 10849
2004-01-14 16:54:21 +00:00
Chris Lattner 1f018c2d01 Toggle sense of flag
llvm-svn: 10838
2004-01-14 02:50:16 +00:00
Chris Lattner a2bfab849f 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.

llvm-svn: 10750
2004-01-10 19:56:59 +00:00
Chris Lattner 0c53031c5e Err, we don't need Config/*.h files for things that are standard C++
llvm-svn: 10742
2004-01-10 19:10:01 +00:00
Chris Lattner b0a5964356 minor comment tweaks
llvm-svn: 10741
2004-01-10 19:07:06 +00:00
Chris Lattner 82167909a8 Refactor writer stuff out of include/llvm/Bytecode/Primitives.h. This is
internal implementation details for the writer, not public interfaces!

llvm-svn: 10738
2004-01-10 18:56:59 +00:00
Chris Lattner dfe0346e96 Finegrainify namespacification
llvm-svn: 10737
2004-01-10 18:49:43 +00:00
Chris Lattner d9cf9b30eb 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.

llvm-svn: 10280
2003-12-01 07:05:31 +00:00
Chris Lattner ea25538936 Remove usage of ConstantPointer
llvm-svn: 10051
2003-11-17 17:28:29 +00:00
Brian Gaeke 960707c335 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke 45eb2eeb74 Explicitly cast type, so we aren't passing output_vbr a size_t.
llvm-svn: 9590
2003-10-29 20:09:01 +00:00
John Criswell 29265fe981 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell 4436c49787 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell 482202a601 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner dc83293a38 add support for new linkage types
llvm-svn: 9228
2003-10-18 06:30:21 +00:00
Chris Lattner 9d57347490 Updated to emit the final 1.0 bytecode format. This supports weak linkage,
more efficient encoding of varargs calls, and the new varargs intrinsics.

llvm-svn: 9221
2003-10-18 05:54:48 +00:00
Alkis Evlogimenos 8faf8d93d5 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().

llvm-svn: 9190
2003-10-17 02:02:40 +00:00
Chris Lattner 2d05c60bac 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.

llvm-svn: 9170
2003-10-16 18:28:50 +00:00
Chris Lattner 44d2c3514a Regularize header file comments
llvm-svn: 9071
2003-10-13 03:32:08 +00:00
Chris Lattner af4c95a051 Fix a spello Misha made while fixing one of my appostrifications
llvm-svn: 8510
2003-09-15 00:33:20 +00:00
Misha Brukman acda7df68b Fixed spelling and grammar.
llvm-svn: 8489
2003-09-11 22:34:13 +00:00
Chris Lattner 8e8593a2c4 Add support for writing volatile load/stores
llvm-svn: 8394
2003-09-08 17:58:37 +00:00
Chris Lattner 55a07adc36 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.

llvm-svn: 8118
2003-08-24 13:47:36 +00:00
Chris Lattner c5372125b9 Remove explicit const qualifiers
llvm-svn: 7245
2003-07-23 14:54:33 +00:00
John Criswell 3ef61afb76 Merged in autoconf branch. This provides configuration via the autoconf
system.

llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner 4a20791049 Fix bug: Assembler/2003-05-03-BytecodeReaderProblem.llx
by emitting the type planes before any constants (which could be constant
expressions involving undefined types!)

llvm-svn: 6285
2003-05-22 18:35:38 +00:00
Chris Lattner f70da10697 Add support for the new va_arg instruction
llvm-svn: 6029
2003-05-08 02:44:12 +00:00
Chris Lattner 35834a503b Add support for reading and writing pointersize/endianness to and from bytecode
llvm-svn: 5839
2003-04-22 18:15:10 +00:00
Chris Lattner 23bf637211 Add support to the bytecode reader/writer for the new linkage types
llvm-svn: 5790
2003-04-16 21:16:05 +00:00
Chris Lattner 428bf5abc9 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.

llvm-svn: 5749
2003-03-19 20:56:46 +00:00
Chris Lattner 5d96597042 Don't keep track of # big vs #small instructions seperately
llvm-svn: 5385
2003-01-21 20:13:49 +00:00
Chris Lattner 98cf1f5d64 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.

llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner ca1725d3c8 Clean up code a bit, no functionality changes.
llvm-svn: 4162
2002-10-14 03:34:17 +00:00
Chris Lattner bf3a099a62 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.

llvm-svn: 4002
2002-10-01 22:38:41 +00:00