Commit Graph

319 Commits

Author SHA1 Message Date
Reid Spencer
9abd138a30 Implement writing of arbitrary precision integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34717 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 02:25:20 +00:00
Reid Spencer
9d6565a5b1 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 02:26:10 +00:00
Chris Lattner
64f150fa92 From Dan Gohman:
While preparing http://llvm.org/PR1198 I noticed several asserts
protecting unprepared code from i128 types that weren't actually failing
when they should because they were written as assert("foo") instead of
something like assert(0 && "foo"). This patch fixes all the cases that a
quick grep found.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34267 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-14 06:20:04 +00:00
Chris Lattner
dec628eead Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
as its main datastructure.  There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34193 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-12 05:18:08 +00:00
Reid Spencer
b508987e84 Undo the last patch. It slowed down bcwriter by 1.8% but only sped up
the bc reader by 0.8%. Deemed "not worth it"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34169 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-11 00:03:39 +00:00
Reid Spencer
fe3cccfb8f For PR1194:
The bcreader counts on "primitive" types being inserted before they are
referenced in other types. With recent changes to the bcwriter, this fact
became exposed since IntegerType is no longer "primitive". We can no longer
count on all IntegerTypes being inserted early. This patch modifies
getOrCreateTypeSlot to insert any sub-type that can't possibly recurse
before we create the slot for the type. This has the benefit of reducing
the number of OpaqueType objects the reader needs to deal with.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34147 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 14:04:08 +00:00
Reid Spencer
c834553b72 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 11:59:10 +00:00
Chris Lattner
863da4c4f5 Change the table datastructure to be a vector<smallvector>, instead of
vector<vector> to avoid allocations.  This speeds up bcwriting of 447.dealII
from 0.8276 to 0.7637s (8.4%).

This concludes this round of proding the bcwriter into submission.  Final
speedup from 24.4s to 0.7637s (32x).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34142 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 07:42:59 +00:00
Chris Lattner
ae052aa5a7 Make BytecodeWriter::outputValueSymbolTable *significantly* less abusive
of memory, through a combination of DenseMap and SmallVector.  This speeds
up bcwriter on 447.dealII from 1.31s to 0.82s (60% faster).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34141 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 07:31:44 +00:00
Chris Lattner
b8cb5fe12c make the datastructure used in BytecodeWriter::outputValueSymbolTable
*slightly* less abusive of memory.  This speeds up the bcwriter from
1.83s to 1.32s (39% faster) on 447.dealII.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34140 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 07:11:51 +00:00
Chris Lattner
f98aad66fa Switch typemap over to DenseMap. No significant speedup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 07:06:46 +00:00
Chris Lattner
362df0d4b7 Switch NodeMap from an std::map to a DenseMap. This speeds up bcwriting
of 447.dealII from 3.3s to 1.8s (80% faster).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34138 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 07:01:05 +00:00
Chris Lattner
dc45f0fb40 use typedefs where appropriate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34136 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 06:42:23 +00:00
Chris Lattner
13dc07c7dc The ModuleLevel vector is often quite sparse. Switch it to a DenseMap. This
speeds up bcwriting of 447.dealII by 40%, from 4.63s to 3.32s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34135 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 06:38:19 +00:00
Chris Lattner
7cad3cf448 Make the ModuleLevel datastructure more sane. When a function-local value
is inserted into the table, it remembers that the value needs to be popped
off.  This makes purgeFunction much faster, speeding up bcwriting of 447.dealII
from 6.8->4.6s (47%).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34133 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 06:09:41 +00:00
Chris Lattner
06f94d5902 Only compute the module levels info once per module, instead of once
per function.  This speeds up bcwriting on 447.dealII from 10.16s to 6.81s
(49%).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34132 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 05:54:33 +00:00
Chris Lattner
77aae264a0 Clone and specialize CreateSlotIfNeeded into CreateFunctionValueSlot to handle
function-local values.  This speeds up bcwriting a small 2.2% (10.384->10.156s
on 447.dealII), but paves the way for more important changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 05:45:09 +00:00
Chris Lattner
2b8269f92b make getSlot/getTypeSlot inline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34130 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 05:18:35 +00:00
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
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
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
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