Commit Graph

43 Commits

Author SHA1 Message Date
Reid Spencer
d2bb887cd1 Bye, Bye Compaction Tables. The benefit compaction tables provides doesn't
outweight its computational costs. This patch removes all compaction
table handling from the bcreader and bcwriter. For the record, here's the
difference betweeen having and not having compaction tables for some tests:

Test             With       Without   Size Chg
Olden/mst       5,602         5,598      +0.1%
viterbi        18,026        17,795      +1.3%
obsequi       162,133       166,663      -2.8%
burg          224,090       228,148      -1.8%
kimwitu++   4,933,263     5,121,159      -3.8%
176.gcc     8,470,424     9,141,539      -7.3%

It seems that it is more beneficial to larger files, but even on the largest
test case we have (176.gcc) it only amounts ot an I/O saving of 7.3%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33661 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 19:36:46 +00:00
Reid Spencer
a54b7cbd45 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
Reid Spencer
78d033e086 For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 07:24:44 +00:00
Reid Spencer
3795ad164a Remove backwards compatibility goop. This is now handled by llvm-upgrade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32146 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 05:47:10 +00:00
Reid Spencer
3da59db637 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Reid Spencer
d798a515e9 Discard code that supported old bytecode formats. This makes the Bytecode
Reader code much easier to read and maintain. Backwards compatibility from
version 5 format has been retained. Older formats will produce an error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31723 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 04:47:22 +00:00
Reid Spencer
4952143236 For PR998:
Fix an infinite loop in the Linker and a few other assorted link problems.

Patch contributed by Scott Michel. Thanks, Scott!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31680 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 11:54:25 +00:00
Reid Spencer
6996feb77e Bump the bytecode version number to 7. Implement upgrade of version 6 and
version 6 bytecode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31573 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 21:27:54 +00:00
Reid Spencer
1628cec4d7 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-26 06:15:43 +00:00
Chris Lattner
f0edc6c18b Fix massive resource leaks in the bytecode reader. Reading a bytecode file
with ParseBytecodeFile used to leak both a ModuleProvider (and related
bytecode parser stuff attached to it) AND a file descriptor, which was
never closed.  This prevented gccld/llvm-ld/llvm-link from linking together
apps with more that ~252 .bc files on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30912 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-12 18:32:30 +00:00
Anton Korobeynikov
7d51544903 - Fixed broken Win32 build
- Removed warning about clobbered parameter in Bytecode/Reader


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30026 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-01 20:35:17 +00:00
Reid Spencer
99655e16a6 For PR797:
Final commit for this bug. This removes the last EH holdouts in LLVM
and turns off exception support by using the -fno-exceptions option. This
leads to the following reduction in library and executable sizes:
                DEBUG BUILD                RELEASE BUILD
         before     after   delta     before   after    delta
lib    162,328K  157,616K   4,712    17,864K  16,416K  1,448K
bin    571,444K  557,156K  14,288    63,296K   56,996K 6,300K

Debug   Improvement: 19,000K (2.59%)
Release Improvement:  7,748K (9.55%)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29882 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 19:54:53 +00:00
Reid Spencer
233fe721c5 For PR797:
Make the Bytecode Reader use setjmp/longjump instead of exceptions to handle
errors. The alternative was even uglier than setjmp/longjump as it would
impact the interface and workings of nearly every function in the reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29819 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 16:09:19 +00:00
Chris Lattner
94aa7f3ba8 Fix a bug in my previous patch which broke building llvm/runtime when using llvm-gcc3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29041 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-07 06:06:06 +00:00
Chris Lattner
0300f3e712 Change the ModuleProvider interface to not throw exceptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29024 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-06 21:35:01 +00:00
Reid Spencer
e2a5fb0e08 Fix auto-upgrade of intrinsics to work properly with both assembly and
bytecode reading. This code is crufty, the result of much hacking to get things
working correctly. Cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25682 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-27 11:49:27 +00:00
Chris Lattner
3bc5a60b80 add bc reader/writer support for inline asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25621 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-25 23:08:15 +00:00
Reid Spencer
3e59546352 Add a flag to identify bytecode files that have intrinsic functions that
need to be upgraded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25445 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-19 06:57:58 +00:00
Chris Lattner
eebac5fee6 Use a map to cache the ModuleType information, so we can do logarithmic
lookups instead of linear time lookups.  This speeds up bc parsing of a
large file from

137.834u 118.256s 4:27.96
to
132.611u 114.436s 4:08.53

with a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23611 91177308-0d34-0410-b5e6-96231b3b80d8
2005-10-03 21:26:53 +00:00
Chris Lattner
fea493030b This is a dummy, it doesn't matter what the ValueType is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22809 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-16 21:59:52 +00:00
Chris Lattner
3f6948d686 remove some dead (always dynamically false) flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21752 91177308-0d34-0410-b5e6-96231b3b80d8
2005-05-06 22:35:09 +00:00
Misha Brukman
8a96c53d36 Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21417 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-21 21:44:41 +00:00
Chris Lattner
cad28bd3a0 Adjust to changes in User class and minor changes in instruction ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19894 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-29 00:36:19 +00:00
Chris Lattner
389bd04b96 Remove a dead field, make the map go to integer type ID to hash better and
avoid a getType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18691 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-09 06:19:44 +00:00
Chris Lattner
1992522abd Cleanups. Null out pointer after freeing it for paranoia
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17855 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-15 21:55:06 +00:00
Reid Spencer
d3539b8a5e Simplify handling of decompression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17769 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-14 22:00:09 +00:00
Reid Spencer
36eea80616 Add comments per CL code review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17578 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-07 18:19:00 +00:00
Reid Spencer
17f52c5c46 Add support for compressed bytecode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17535 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-06 23:17:23 +00:00
Chris Lattner
a79e7cca0d Add support for undef, unreachable, and function flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17054 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:18:16 +00:00
Chris Lattner
1c765b0037 Fit to 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16964 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-14 01:49:34 +00:00
Reid Spencer
572c256519 Add boolean file format flags in preparation for version 5 bytecode.
Remove the "processFunctions" boolean from ParseBytecode as it is no
longer needed. This is part of avoiding double reading of functions
when analyzing bytecode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15982 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-21 20:50:49 +00:00
Reid Spencer
38d54be85b Bytecode File Format Changes:
- File format version number bumped to 4
- Writer will now align nothing
- Reader now only expects alignment for version 3 or earlier


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15875 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 07:45:14 +00:00
Chris Lattner
2c6c14d1a5 Make getGlobalTableValue not use getTypeSlot, this speeds up the bc reader
by 5% on eon


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15452 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 00:19:23 +00:00
Chris Lattner
45b5dd2918 Do not do a linear std::find to reconstruct information we had, but later threw
away.  This speeds up by .bc reader by 30% in a profile build on 252.eon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15450 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-03 23:41:28 +00:00
Reid Spencer
7d146e1107 Don't create a backwards compatibility flag for something that was a
regression bug introduced in release 1.2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15219 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:32:51 +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
89fc0e3ce0 User ValueListTy as the type of the ValueList. This avoides the ValueList
from being treated like a Function which can cause the contents of the list
to be come invalidated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14940 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-18 00:13:12 +00:00
Reid Spencer
66906518ed - Rename two methods to give them more meaning
- Add read_float and read_double in preparation for a correct
  implementation of bytecode floating point support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14764 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-11 17:24:05 +00:00
Reid Spencer
2439972a61 Error Handling Cleanup:
- get rid of PARSE_ERROR macro
- add error(std::string) function
- use error(std::string) for all errors
- make input dependent asserts call error(std::string) instead
- ensure asserts are only for logic bugs, not input discrepancies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14729 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-09 22:21:33 +00:00
Reid Spencer
ba466362c4 Remove definition and use of OtherVal enumerator. This just fixes a thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14634 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-06 01:30:36 +00:00
Reid Spencer
5c15fe5cf8 Finalize bytecode dumping. The "handleFinish" method was getting called
too soon so the function data was not getting dumped (it was generated
after the call handleFinish). Also cleaned up the output format for
proper indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14627 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-05 00:57:50 +00:00
Reid Spencer
a86159cd4b - Make ValueList an "OtherVal" user of Values to ensure it doesn't get
mistaken for anything else.
- Move function descriptions to Reader.cpp file per Chris.
- Remove tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14602 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-04 11:04:56 +00:00
Reid Spencer
f89143c7de This is a slimming down of the previous ReaderInternals.h that just
declares the BytecodeReader class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14495 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-29 23:31:01 +00:00