Commit Graph

727 Commits

Author SHA1 Message Date
Reid Spencer
e2a6acd13f Use a simpler constructor for ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:25:31 +00:00
Reid Spencer
fa1353ca52 Implement reading of arbitrary precision integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 02:25:48 +00:00
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
ac9dcb94dd For PR1195:
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34300 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 03:39:18 +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
1893952826 Use a SmallVector to reduce heap traffic. This speeds up bcreader 10%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 07:28:20 +00:00
Chris Lattner
d0e44c2e05 now that we can pass ranges into CallInst ctors, eliminate vector heap traffic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34229 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 06:30:42 +00:00
Chris Lattner
e433919686 stop passing vector into ctors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-13 01:53:54 +00:00
Chris Lattner
dd8cec59fc avoid creating a temporary string when reading the symbol table for a
module.  This speeds up the bcreader 11%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34198 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-12 18:53:43 +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
91c4af242a Compaction tables don't exist any more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34148 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 14:07:56 +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
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