Reid Spencer
09575bac2e
For PR1195:
...
Change use of "packed" term to "vector" in comments, strings, variable
names, etc.
llvm-svn: 34300
2007-02-15 03:39:18 +00:00
Reid Spencer
d84d35ba70
For PR1195:
...
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.
llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Chris Lattner
4da5e17cfc
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.
llvm-svn: 34267
2007-02-14 06:20:04 +00:00
Chris Lattner
e786eaa3b0
Use a SmallVector to reduce heap traffic. This speeds up bcreader 10%
...
llvm-svn: 34231
2007-02-13 07:28:20 +00:00
Chris Lattner
abe7342dc2
now that we can pass ranges into CallInst ctors, eliminate vector heap traffic
...
llvm-svn: 34229
2007-02-13 06:30:42 +00:00
Chris Lattner
4d8861efaa
stop passing vector into ctors
...
llvm-svn: 34218
2007-02-13 01:53:54 +00:00
Chris Lattner
8d160d68b8
avoid creating a temporary string when reading the symbol table for a
...
module. This speeds up the bcreader 11%.
llvm-svn: 34198
2007-02-12 18:53:43 +00:00
Chris Lattner
32ab643df7
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%.
llvm-svn: 34193
2007-02-12 05:18:08 +00:00
Reid Spencer
0aea61a57e
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"
llvm-svn: 34169
2007-02-11 00:03:39 +00:00
Reid Spencer
9aac907740
Compaction tables don't exist any more.
...
llvm-svn: 34148
2007-02-10 14:07:56 +00:00
Reid Spencer
6e4c277858
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.
llvm-svn: 34147
2007-02-10 14:04:08 +00:00
Reid Spencer
1673159125
Fix a comment.
...
llvm-svn: 34146
2007-02-10 11:59:10 +00:00
Chris Lattner
31b60980dc
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).
llvm-svn: 34142
2007-02-10 07:42:59 +00:00
Chris Lattner
d7f677c590
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).
llvm-svn: 34141
2007-02-10 07:31:44 +00:00
Chris Lattner
2aed25cfc9
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.
llvm-svn: 34140
2007-02-10 07:11:51 +00:00
Chris Lattner
05aeb105df
Switch typemap over to DenseMap. No significant speedup.
...
llvm-svn: 34139
2007-02-10 07:06:46 +00:00
Chris Lattner
9082be2593
Switch NodeMap from an std::map to a DenseMap. This speeds up bcwriting
...
of 447.dealII from 3.3s to 1.8s (80% faster).
llvm-svn: 34138
2007-02-10 07:01:05 +00:00
Chris Lattner
733a841633
use typedefs where appropriate
...
llvm-svn: 34136
2007-02-10 06:42:23 +00:00
Chris Lattner
cdde9ce28b
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.
llvm-svn: 34135
2007-02-10 06:38:19 +00:00
Chris Lattner
e06c2fd4df
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%).
llvm-svn: 34133
2007-02-10 06:09:41 +00:00
Chris Lattner
82a06ec1ca
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%).
llvm-svn: 34132
2007-02-10 05:54:33 +00:00
Chris Lattner
a6214fea08
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.
llvm-svn: 34131
2007-02-10 05:45:09 +00:00
Chris Lattner
0132599b8d
make getSlot/getTypeSlot inline
...
llvm-svn: 34130
2007-02-10 05:18:35 +00:00
Chris Lattner
832676a772
getTypeSlot can never fail
...
llvm-svn: 34129
2007-02-10 05:17:48 +00:00
Chris Lattner
ce57e528f5
getSlot can never fail. Make it assert internally, eliminate checks in
...
clients. Same for getTypeSlot.
llvm-svn: 34128
2007-02-10 05:13:03 +00:00
Chris Lattner
1e91abbf61
simplify getOrCreateTypeSlot, eliminat doInsertType. Eliminate post-order iteration stuff.
...
llvm-svn: 34127
2007-02-10 05:02:50 +00:00
Chris Lattner
d090c6beed
simplify and speed up recursive type processing.
...
llvm-svn: 34126
2007-02-10 04:57:36 +00:00
Chris Lattner
e2154a1fa1
rename getOrCreateSlot -> CreateSlotIfNeeded. Noone cares about the retval
...
llvm-svn: 34125
2007-02-10 04:54:01 +00:00
Chris Lattner
34495b1b6d
refactor callers of insertType. inline insertType into its one remaining caller.
...
llvm-svn: 34124
2007-02-10 04:51:21 +00:00
Chris Lattner
fa60ec48d3
simplify code.
...
llvm-svn: 34123
2007-02-10 04:47:51 +00:00
Chris Lattner
53d0043173
simplify some logic, reduce nesting
...
llvm-svn: 34122
2007-02-10 04:42:30 +00:00
Chris Lattner
2a666a0b29
Remove dead ctor
...
llvm-svn: 34121
2007-02-10 04:38:34 +00:00
Chris Lattner
12002936aa
ModuleContainsAllFunctionConstants is always true
...
llvm-svn: 34120
2007-02-10 04:36:10 +00:00
Chris Lattner
c7627ca239
only one client of getOrCreateSlot can pass a void typed value. Check type
...
there.
llvm-svn: 34119
2007-02-10 04:31:52 +00:00
Chris Lattner
3a28413d38
inline hasNullValue, rename some variables, simplify some code.
...
llvm-svn: 34118
2007-02-10 04:29:03 +00:00
Chris Lattner
0d549b217b
merge insertValue into its single caller, eliminate some redundant checks.
...
llvm-svn: 34117
2007-02-10 04:25:02 +00:00
Chris Lattner
90a8f472da
merge doInsertValue into insertValue
...
llvm-svn: 34116
2007-02-10 04:22:30 +00:00
Chris Lattner
dcb209ac9c
insertvalue's second operand is always false
...
llvm-svn: 34115
2007-02-10 04:19:31 +00:00
Chris Lattner
ee030194f9
remove dead 'dontIgnore' flag for insertType
...
llvm-svn: 34114
2007-02-10 04:17:41 +00:00
Chris Lattner
35e18b0d05
rename getSlot -> getSlotType and getOrCreateSlot ->getOrCreateTypeSlot
...
for types.
llvm-svn: 34113
2007-02-10 04:15:40 +00:00
Reid Spencer
5808739fac
Use int32_t and uint32_t to hopefully help weak compilers (cygwin) not
...
generate errors about being unable to resolve overloaded type.
llvm-svn: 34103
2007-02-09 18:03:35 +00:00
Reid Spencer
ca444882bd
Make SlotCalculator::getPlane an inline function. It is used inside loops.
...
llvm-svn: 34091
2007-02-09 15:25:50 +00:00
Chris Lattner
02be9919ab
remove unneeded #includes
...
llvm-svn: 34086
2007-02-09 07:54:13 +00:00
Chris Lattner
b3905c70c4
remove dead code, the outputConstants function is now only called at module scope.
...
llvm-svn: 34085
2007-02-09 07:53:20 +00:00
Chris Lattner
fc30d1bb69
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.
llvm-svn: 34084
2007-02-09 07:51:47 +00:00
Chris Lattner
ddfead20e8
move archive-specific stuff out of bcreader into archive library.
...
llvm-svn: 34022
2007-02-07 23:53:17 +00:00
Chris Lattner
d220dc1426
move an llvmc-specific function out of the bcreader into llvmc.
...
llvm-svn: 34021
2007-02-07 23:48:32 +00:00
Chris Lattner
daba41cfb9
move AnalyzeBytecodeFile out of ReaderWrappers.cpp into Analyzer.cpp. Now
...
lli doesn't link in Analyzer.cpp.
llvm-svn: 34020
2007-02-07 23:46:55 +00:00
Chris Lattner
a0e49f2ead
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.
llvm-svn: 34012
2007-02-07 21:41:02 +00:00
Chris Lattner
41f5c64ae1
Move compressor out of the core Reader.cpp file.
...
llvm-svn: 34007
2007-02-07 19:49:01 +00:00