Commit Graph

312 Commits

Author SHA1 Message Date
Misha Brukman
afca90e832 Implement ModuleProvider::materializeModule() by only materializing functions
that are still left in the lazy reader map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10944 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-21 22:55:34 +00:00
Chris Lattner
f2d577b27a SlotCalculator.h moved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10931 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 19:50:34 +00:00
Chris Lattner
db9b998f63 Move SlotCalculator.h from include/llvm to include/llvm/Analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10930 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 19:50:12 +00:00
Chris Lattner
62f8bf0566 Fix PR212 - Bytecode reader misreads 'long -9223372036854775808'!
Fix testcase test/Regression/Assembler/2004-01-20-MaxLongLong.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10928 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 19:13:07 +00:00
Chris Lattner
cdaff32ef6 Fix bogus warning and simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10924 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 17:06:29 +00:00
Chris Lattner
68e3dbc493 Major changes. Now we only compactify individual type planes if it is in
fact "profitable" to do so.  This makes compactification "free" for small
programs (ie, it is completely disabled) and even helps large programs by
not having to encode pointless compactification planes.

On 176.gcc, this saves 50K from the bytecode file, which is, alas only
a couple percent.

This concludes my head bashing against the bytecode format, at least for
now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10922 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 00:57:32 +00:00
Chris Lattner
a2b4f93a1b add a method proto, make a method not inline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10921 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-20 00:54:47 +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
89e025387e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10914 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:08:15 +00:00
Chris Lattner
614cdcd002 Add support for building the compactiontable 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@10913 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:07:07 +00:00
Chris Lattner
af894e963b Add support for representing the "compaction table"
Change protected members to private.  Nothing should subclass SlotCalculator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10912 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-18 21:03:49 +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
d5c59d5c84 Cleanups & efficiency improvements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10888 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 20:24:09 +00:00
Chris Lattner
8c202cdbda The bcwriter does not want ConstantPointerRef's to be indexed, and the asmwriter never did!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:47:15 +00:00
Chris Lattner
7be08bfae1 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10884 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:46:56 +00:00
Chris Lattner
933619912b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10883 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:45:25 +00:00
Chris Lattner
ff47e7d02e Fix more breakage with string change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10882 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:39:06 +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
44d0eebc13 Fix PR73
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 17:55:01 +00:00
Chris Lattner
570fb1cbd8 Fix brokenness in my last checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10874 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 16:56:15 +00:00
Chris Lattner
7969dc2bec 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 06:13:09 +00:00
Chris Lattner
c8434e3d71 Remove the optimization that depends on ENDIAN_LITTLE: it's not worth it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10870 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 06:11:30 +00:00
Chris Lattner
7851e1b328 Improve comments, add support for remembering the constants strings that
are to be emitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10866 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:37:43 +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
9e893e8a3d Version 1.2 now supports encoding strings as a special case, to avoid having
to emit all of those sbyte constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10863 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:35:21 +00:00
Chris Lattner
dcea63026f When emitting bytecode, handle strings specially. Do not add the characters
that make up the strings to the slotcalculator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10862 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:34:39 +00:00
Chris Lattner
4e8683664d Like output_data, it's obvious that input_data was only used with 1 character
data.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10861 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:03:22 +00:00
Chris Lattner
0a3a27b0ae It is obvious that this has never been used for outputing more than a single
byte, it's totally endian incorrect!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10857 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 18:50:28 +00:00
Chris Lattner
44e38034d5 Be const correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10856 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 18:41:38 +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
c08912f917 Remove support for the pre-1.0 bytecode version #1. This will become
the bytecode revision generated by LLVM 1.2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10848 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 16:44:44 +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
8ce750145d The only clients of the slot calculator are now the asmwriter and bcwriter.
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not.  This makes it
reasonable to add bcwriter specific stuff to it as necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10837 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 02:49:34 +00:00
Chris Lattner
b16689b647 Don't use ConstantExpr::getShift anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:08:43 +00:00
Chris Lattner
92fa44c1cf Urg, remove testing code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10757 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-11 23:30:03 +00:00
Chris Lattner
9380297bc0 Fix a regression that I introduced yesterday. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10756 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-11 23:29:26 +00:00
Chris Lattner
a14b0d441d Check in two changes:
The first change (which is disabled) compactifies all of the function constant
pools into the global constant pool, in an attempt to reduce the amount of
duplication and overhead.  Unfortunately, as the comment indicates, this is
not yet a win, so it is disabled.

The second change sorts the typeid's so that those types that can be used
by instructions in the program appear earlier in the table than those that
cannot (such as structures and arrays).  This causes the instructions to
be able to use the dense encoding more often, saving about 5K on 254.gap.
This is only a .65% savings though, unfortunately. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10754 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 23:46:13 +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
3446ae8337 * 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10739 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:00:15 +00:00
Chris Lattner
4443019b7d Refactor writer stuff out of include/llvm/Bytecode/Primitives.h. This is
internal implementation details for the writer, not public interfaces!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10738 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 18:56:59 +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
258b5375b4 Inching our way towards fixing PR82
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10721 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 05:42:34 +00:00
Chris Lattner
f63aeece6f remove some useless #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10654 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-30 07:55:21 +00:00
Chris Lattner
b70abe1c5a Use new getFileSize function instead of sys/stat.h directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10650 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-30 07:40:35 +00:00