Commit Graph

278 Commits

Author SHA1 Message Date
Chris Lattner e33ddf57f6 This debugging hook is no longer needed.
llvm-svn: 11233
2004-02-09 17:20:52 +00:00
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
Misha Brukman ba3c670292 Implement ModuleProvider::materializeModule() by only materializing functions
that are still left in the lazy reader map.

llvm-svn: 10944
2004-01-21 22:55:34 +00:00
Chris Lattner c70b3f63cc SlotCalculator.h moved
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner 467d977868 Fix PR212 - Bytecode reader misreads 'long -9223372036854775808'!
Fix testcase test/Regression/Assembler/2004-01-20-MaxLongLong.llx

llvm-svn: 10928
2004-01-20 19:13:07 +00:00
Chris Lattner 6cc66d93f1 Fix bogus warning and simplify code
llvm-svn: 10924
2004-01-20 17:06:29 +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 e104d88f83 Add support for reading 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: 10914
2004-01-18 21:08:15 +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 e2f6317436 Allow bytecode files to refer directly to global values as constants, instead
of forcing them to go through ConstantPointerRef's.  This allows bytecode
files to mirror .ll files, allows more efficient encoding, and makes it easier
to eventually eliminate CPR's.

llvm-svn: 10883
2004-01-15 18:45:25 +00:00
Chris Lattner 980ff78e3c Fix more breakage with string change.
llvm-svn: 10882
2004-01-15 18:39:06 +00:00
Chris Lattner 394fc96f39 Fix PR73: bytecode format inconsistent
llvm-svn: 10876
2004-01-15 17:55:09 +00:00
Chris Lattner 7c73b19bb8 Fix PR73
llvm-svn: 10875
2004-01-15 17:55:01 +00:00
Chris Lattner f63a4ecc0b Fix brokenness in my last checking
llvm-svn: 10874
2004-01-15 16:56:15 +00:00
Chris Lattner faaf32db19 Change all of the bytecode reader primitives to throw exceptions instead of
returning error codes.  Because they don't return an error code, they can
return the value read, which simplifies the code and makes the reader more
efficient (yaay!).

Also eliminate the special case code for little endian machines.

llvm-svn: 10871
2004-01-15 06:13: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 394afe0f90 Version 1.2 now supports encoding strings as a special case, to avoid having
to emit all of those sbyte constants.

llvm-svn: 10863
2004-01-14 23:35:21 +00:00
Chris Lattner c6098c06d5 Like output_data, it's obvious that input_data was only used with 1 character
data.

llvm-svn: 10861
2004-01-14 23:03:22 +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 893b184db0 Remove support for the pre-1.0 bytecode version #1. This will become
the bytecode revision generated by LLVM 1.2.

llvm-svn: 10848
2004-01-14 16:44:44 +00:00
Chris Lattner 1f018c2d01 Toggle sense of flag
llvm-svn: 10838
2004-01-14 02:50:16 +00:00
Chris Lattner 1b7d4d7b63 Don't use ConstantExpr::getShift anymore
llvm-svn: 10791
2004-01-12 19:08:43 +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 4282cbb93a * finegrainify namespacification of ArchiveReader.cpp
* Refactor reader stuff out of include/llvm/Bytecode/Primitives.h.  This is
  internal implementation details for the reader, not public interfaces!

llvm-svn: 10739
2004-01-10 19:00:15 +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 bc39a1a8c4 Inching our way towards fixing PR82
llvm-svn: 10721
2004-01-09 05:42:34 +00:00
Chris Lattner 328e067246 remove some useless #includes
llvm-svn: 10654
2003-12-30 07:55:21 +00:00
Chris Lattner 9b75157c04 Use new getFileSize function instead of sys/stat.h directly.
llvm-svn: 10650
2003-12-30 07:40:35 +00:00
Chris Lattner a462161f9c Factor FDHandle out of the bytecode reader into the FileUtilities.h support
routines.

llvm-svn: 10642
2003-12-29 21:35:05 +00:00
Chris Lattner 4a2a8f5821 minor cleanups
llvm-svn: 10612
2003-12-26 06:16:00 +00:00
John Criswell bd10d09b07 Reverted back to revision 1.11. The previous fix doesn't really fix
anything; it just causes the bug to go dormant.

llvm-svn: 10585
2003-12-22 16:22:49 +00:00
John Criswell d8c7a7fbaa Fix PR#193.
Modified ReadArchiveBuffer() so that it dynamically allocates the
std::string object used to hold the bytecode object file's name.  This is
necessary because it is passed by reference to the new Module that is
allocated to represent the bytecode object, and previously we were
using a std::string that disappeared on function exit.

llvm-svn: 10565
2003-12-20 22:37:29 +00:00
Brian Gaeke 0a9980582d Make getObjectType() smarter about ranlibbed Mac OS X archives.
llvm-svn: 10493
2003-12-17 00:18:18 +00:00
Brian Gaeke d24cfed317 Throw better error messages, by calling strerror(errno) when we
get an error inside the bytecode reader.

llvm-svn: 10415
2003-12-12 00:47:44 +00:00
Brian Gaeke 36fb4f19cd In getObjectType(), doxygenify comment, and take a pointer to the
beginning of the archive member data as an argument.

Get rid of ParseLongFilenameSection(), which is dead.

In ReadArchiveBuffer(), implement support for 4.4BSD/MacOSX long filenames.
This is kind of invasive, because they prepend the long filename to the archive
member data, and then lie about the size. So we have to keep track of the real
size.

llvm-svn: 10392
2003-12-11 00:38:04 +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 9c68fa3ab1 * Finegrainify namespacification
* 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

llvm-svn: 10085
2003-11-19 17:27:18 +00:00