Commit Graph

751 Commits

Author SHA1 Message Date
Chris Lattner
972b4dccaf getTypeSlot can never fail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34129 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 05:17:48 +00:00
Chris Lattner
a2bdad49c9 getSlot can never fail. Make it assert internally, eliminate checks in
clients.  Same for getTypeSlot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34128 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 05:13:03 +00:00
Chris Lattner
8183cf62f6 simplify getOrCreateTypeSlot, eliminat doInsertType. Eliminate post-order iteration stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34127 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 05:02:50 +00:00
Chris Lattner
25c0293f20 simplify and speed up recursive type processing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34126 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:57:36 +00:00
Chris Lattner
94bec4fbf8 rename getOrCreateSlot -> CreateSlotIfNeeded. Noone cares about the retval
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:54:01 +00:00
Chris Lattner
17d60ce795 refactor callers of insertType. inline insertType into its one remaining caller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34124 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:51:21 +00:00
Chris Lattner
25c3fa3152 simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34123 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:47:51 +00:00
Chris Lattner
36e1173baa simplify some logic, reduce nesting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34122 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:42:30 +00:00
Chris Lattner
4ef92d8d64 Remove dead ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:38:34 +00:00
Chris Lattner
7f481e5224 ModuleContainsAllFunctionConstants is always true
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:36:10 +00:00
Chris Lattner
1ef9ca4442 only one client of getOrCreateSlot can pass a void typed value. Check type
there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34119 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:31:52 +00:00
Chris Lattner
44bd331c22 inline hasNullValue, rename some variables, simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34118 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:29:03 +00:00
Chris Lattner
87dddc5262 merge insertValue into its single caller, eliminate some redundant checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:25:02 +00:00
Chris Lattner
75e2cf555c merge doInsertValue into insertValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34116 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:22:30 +00:00
Chris Lattner
618181ea0e insertvalue's second operand is always false
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:19:31 +00:00
Chris Lattner
330fce71b2 remove dead 'dontIgnore' flag for insertType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34114 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:17:41 +00:00
Chris Lattner
cb43fdc40c rename getSlot -> getSlotType and getOrCreateSlot ->getOrCreateTypeSlot
for types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 04:15:40 +00:00
Reid Spencer
7d0034194c Use int32_t and uint32_t to hopefully help weak compilers (cygwin) not
generate errors about being unable to resolve overloaded type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34103 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-09 18:03:35 +00:00
Reid Spencer
394355e4cc Make SlotCalculator::getPlane an inline function. It is used inside loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34091 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-09 15:25:50 +00:00
Chris Lattner
191d73187a remove unneeded #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34086 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-09 07:54:13 +00:00
Chris Lattner
8dcd81cc0e remove dead code, the outputConstants function is now only called at module scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34085 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-09 07:53:20 +00:00
Chris Lattner
ba6de4b1cf 1. constants can never occur in the symbol table.
2. All function-level constants are now incorporated into the module-level
  constant pool, since the compaction table was removed.  Eliminate extra
  work to check for them.

This speeds up the bcwriter from 24.4s to 13.1s on 447.dealII and .73 -> .56s
on kc++ in a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34084 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-09 07:51:47 +00:00
Chris Lattner
f36c7b860d move archive-specific stuff out of bcreader into archive library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 23:53:17 +00:00
Chris Lattner
7cf7c2b703 move an llvmc-specific function out of the bcreader into llvmc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34021 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 23:48:32 +00:00
Chris Lattner
c6d0b16429 move AnalyzeBytecodeFile out of ReaderWrappers.cpp into Analyzer.cpp. Now
lli doesn't link in Analyzer.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 23:46:55 +00:00
Chris Lattner
f2e292ce58 push bytecode decompressor out through APIs. Now the bytecode reader
api's look like this:

ModuleProvider *getBytecodeModuleProvider(
  const std::string &Filename,  ///< Name of file to be read
  BCDecompressor_t *BCDC = Compressor::decompressToNewBuffer,
  std::string* ErrMsg = 0,      ///< Optional error message holder
  BytecodeHandler* H = 0        ///< Optional handler for reader events
);

This is ugly, but allows a client to say:

  getBytecodeModuleProvider("foo", 0);

If they do this, there is no dependency on the compression libraries, saving
codesize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34012 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 21:41:02 +00:00
Chris Lattner
0d3382ac92 Move compressor out of the core Reader.cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34007 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 19:49:01 +00:00
Chris Lattner
4f9ff5a85c remove dead ivars, thanks to Reid for noticing this!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33995 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 07:19:19 +00:00
Chris Lattner
7b6040b417 remove the handleVBR32/handleVBR64 callbacks. They are very fine-grained.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33994 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 06:53:02 +00:00
Chris Lattner
670ccfe6a4 parse constantexpr arguments into a smallvector: 1.5% speedup reading 176.gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33980 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 05:15:28 +00:00
Chris Lattner
63cf59ed3f Eliminate std::vectors from the bcanalyzer interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33978 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-07 05:08:39 +00:00
Reid Spencer
ef9b9a7939 For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 20:47:22 +00:00
Reid Spencer
832254e1c2 Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 02:16:23 +00:00
Chris Lattner
4c3d3a99d5 eliminate a temporary vector while parsing gep's from bc files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 19:56:15 +00:00
Chris Lattner
e013540654 eliminate a temporary vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 04:43:46 +00:00
Reid Spencer
5cbf985dcb For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 20:08:39 +00:00
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
f0876c7cb7 This file has been dead for a long time. Remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33596 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 08:04:14 +00:00
Reid Spencer
aacc35a794 For PR761:
Remove the Endianness and PointerSize fields from the ModuleHeader and
replace it with the DataLayout field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33529 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 08:10:24 +00:00
Reid Spencer
021830bb03 Back out last changes for dataLayout. Much more work is needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33347 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 00:07:16 +00:00
Reid Spencer
4b70161b69 For PR761:
Implement reading and writing of the Module's data layout string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 23:24:24 +00:00
Chris Lattner
42a7551725 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:27:26 +00:00
Reid Spencer
790366be6d Make sure that GEP indices are only 32 or 64 bits. We're not ready for
indices with other bit sizes yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33167 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:10:02 +00:00
Reid Spencer
b61c1cefb2 Get rid of some useless distinction between bool and integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33166 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:09:12 +00:00
Chris Lattner
fb93931939 remove unneeded special case for bool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:26:17 +00:00
Chris Lattner
a55866f2cc Eliminate a log(n) lookup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33155 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:23:08 +00:00
Anton Korobeynikov
7f70559bc4 * PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33136 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 19:20:47 +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
579dca12c2 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 04:24:46 +00:00
Reid Spencer
4fe16d607d Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 18:21:29 +00:00
Zhou Sheng
6b6b6ef167 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 12:24:14 +00:00
Chris Lattner
f3ccb692f2 remove support for old-style varargs upgrading
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32979 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-07 06:45:57 +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
88cfda2122 For PR950:
Update for signless integer types and parameter attribute implementation.
Of significant note:
  1. This changes the bytecode format yet again.
  2. There are 1/2 as many integer type planes (this is a good thing)
  3. GEP indices now use only 1 bit to identify their type which means
     more GEP instructions won't be relegated to format 0 (size win)
  4. Parameter attributes are implemented but currently being stored
     verbosely for each function type. Some other day this needs to be
     optimized for size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32783 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:44:24 +00:00
Chris Lattner
1c560adfd1 switch statistics over to not use static ctors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32709 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-19 23:16:47 +00:00
Bill Wendling
c252fac907 This snuck in. Reverted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32638 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-17 11:11:10 +00:00
Bill Wendling
5c7e326585 Added an automatic cast to "std::ostream*" etc. from OStream. We then can
rework the hacks that had us passing OStream in. We pass in std::ostream*
instead, check for null, and then dispatch to the correct print() method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32636 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-17 05:15:13 +00:00
Reid Spencer
c6d416ada1 Remove an extraneous { at the end of a block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32613 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 21:46:37 +00:00
Reid Spencer
9b84ad14f4 Fix long standing issue with propagating error message back to caller. This
has been a problem since exceptions were removed from the BytecodeReader.
Error messages are now captured from ModuleProvider::releaseModule as well
as after a longjmp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32608 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 19:49:23 +00:00
Reid Spencer
cd5561a56e For PR1050:
Convert asserts into error messages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32607 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-15 19:44:51 +00:00
Reid Spencer
a77fa7edbf Create the cast constant expression that was read instead of attempting
to infer the cast from its operand and type. This fixes:
test/Regression/Bytecode/2006-12-11-Cast-ConstExpr.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32450 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-11 23:20:20 +00:00
Andrew Lenharth
38ecbf18eb Packed Structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32361 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:06:16 +00:00
Bill Wendling
bcd2498f4f Removed more <iostream> includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32321 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 20:28:15 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Chris Lattner
ac0b6ae358 Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 17:46:33 +00:00
Reid Spencer
cae6053587 Fix a CmpInst writing bug by removing merge cruft that I *know* I've removed
before. Also, make sure we write the predicate value for Cmp instructions
using instruction format 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32253 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-06 04:27:07 +00:00
Reid Spencer
595b477915 For PR950: Implement read/write of ICmp and FCmp constant expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32172 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-04 05:23:49 +00:00
Reid Spencer
9f132765a2 Support ICmp/FCmp constant expression reading and writing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32160 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 17:17:02 +00:00
Reid Spencer
c8dab49aad Implement reading and writing of the ICmp and FCmp instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32149 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-03 06:28:54 +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
Bill Wendling
68fe61d6a1 Replacing std::iostreams with llvm iostreams. Some of these changes involve
adding a temporary wrapper around the ostream to make it friendly to
functions expecting an LLVM stream. This should be fixed in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31990 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-29 00:19:40 +00:00
Bill Wendling
a21900d5a4 Use ostream instead of iostream
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31986 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 22:49:32 +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
967413fa20 Have ConstantExprs upgrade opcodes the same way as instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31841 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-18 04:37:19 +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
3822ff5c71 For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-08 06:47:33 +00:00
Reid Spencer
e03f09c64f Remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31401 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 01:44:51 +00:00
Reid Spencer
3ed469ccd7 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:25:50 +00:00
Reid Spencer
0a783f783c For PR950:
Replace the REM instruction with UREM, SREM and FREM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31369 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 01:53:59 +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
Reid Spencer
b83eb6447b For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 07:07:24 +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
93c2b37340 Small fixes for supporting dll* linkage types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-17 13:06:18 +00:00
Anton Korobeynikov
b74ed07bfd Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-14 18:23:27 +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
0b5a504d10 For PR797:
Remove exception throwing/handling from lib/Bytecode, and adjust its users
to compensate for changes in the interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29875 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-25 17:43:11 +00:00
Reid Spencer
0ff2d31766 For PR797:
Remove exception handling from the bytecode archiver and adjust the llvm-ar
tool to accommodate the new interfaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29866 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-24 23:45:08 +00:00
Reid Spencer
5a060775da For PR797:
Eliminate exception throwing from Path::renamePathOnDisk and adjust its
users correspondingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29843 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-23 07:30:48 +00:00
Reid Spencer
e5c9cb5eb6 For PR797:
Remove exceptions from the Path::create*OnDisk methods. Update their users
to handle error messages via arguments and result codes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29840 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-23 00:39:35 +00:00
Reid Spencer
a5ec45d3c1 Inverse the error check logic for the MappedFile::map() call. It returns
a null pointer when there is an error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29827 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 17:58:50 +00:00
Reid Spencer
b152fd247c For PR797:
Adjust the use of MappedFile to its new non-throwing interface. We just
propagate the exceptions if an error occurs. This will get cleaned up
later, incrementally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29820 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 16:10:12 +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
Reid Spencer
751ca6b48c For PR797:
Adjust to new interface for MappedFile. Note that the new "throw"
statements will be removed later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29818 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-22 16:07:44 +00:00
Chris Lattner
0c33231eff Modify Path::eraseFromDisk to not throw an exception.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29400 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 22:29:50 +00:00
Chris Lattner
c847f7caec formatting cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29396 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 22:07:54 +00:00
Chris Lattner
252ad03d7d Change Path::getStatusInfo to return a boolean and error string on an error
instead of throwing an exception.  This reduces the amount of code that is
exposed to exceptions (e.g. FileUtilities), though it is clearly only one step
along the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29395 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 22:03:44 +00:00
Chris Lattner
435540f434 Exceptions are thrown by and through this library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29393 91177308-0d34-0410-b5e6-96231b3b80d8
2006-07-28 22:00:24 +00:00