Commit Graph

69 Commits

Author SHA1 Message Date
Reid Spencer 2fa95bcd68 Remove Tabs.
llvm-svn: 14611
2004-07-04 11:46:15 +00:00
Reid Spencer a52b0009ea 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.

llvm-svn: 14610
2004-07-04 11:45:47 +00:00
Chris Lattner 4ba8a8d1ef No functionality changes here:
* Some warning fixes for MSVC
  * Minor simplification to the deque scanning code

llvm-svn: 14417
2004-06-25 20:52:10 +00:00
Chris Lattner ccd8ed145a Fix more warnings building with VC++
llvm-svn: 14391
2004-06-25 00:35:55 +00:00
Reid Spencer f2f34b3052 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.

llvm-svn: 13842
2004-05-27 20:18:51 +00:00
Reid Spencer 0aff01a239 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).

llvm-svn: 13785
2004-05-26 07:37:11 +00:00
Reid Spencer 660ea5fadb Changed to use SymbolTable's new iteration interfaces.
llvm-svn: 13759
2004-05-25 17:29:59 +00:00
Chris Lattner 15701e84d1 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.

llvm-svn: 12651
2004-04-05 01:27:26 +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 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 394fc96f39 Fix PR73: bytecode format inconsistent
llvm-svn: 10876
2004-01-15 17:55:09 +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 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 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
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
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 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
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 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 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
Chris Lattner 64eea749de *** empty log message ***
llvm-svn: 3105
2002-07-26 18:40:14 +00:00
Chris Lattner 36d2c7c39b Register the WriteBytecodePass
llvm-svn: 3033
2002-07-23 19:56:44 +00:00
Vikram S. Adve c1b6474a60 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.

llvm-svn: 2898
2002-07-14 23:07:51 +00:00
Anand Shukla eaa2e7204e changes to make it compatible with 64bit gcc
llvm-svn: 2790
2002-06-25 20:44:04 +00:00
Chris Lattner 7076ff29ed MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2778
2002-06-25 16:13:21 +00:00
Chris Lattner ca14237696 Split ConstantVals.h into Constant.h and Constants.h
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner bc1f09299e Make debugging code not use getStrValue
llvm-svn: 2295
2002-04-18 18:14:56 +00:00
Chris Lattner 2e9fa6d101 Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.

llvm-svn: 2216
2002-04-09 19:48:49 +00:00