Chris Lattner
dca56cbd9a
Get logical operations to like packed types, allow BinOp::getNot to create
...
the right vector of -1's as its operand.
llvm-svn: 24906
2005-12-21 18:22:19 +00:00
Chris Lattner
7d4d93c52c
Add a flag to Module::getGlobalVariable to allow it to return vars with
...
internal linkage.
Patch provided by Evan Jones, thanks!
llvm-svn: 24604
2005-12-05 05:30:21 +00:00
Chris Lattner
f519d1c6ef
This requires proper dominance
...
llvm-svn: 24408
2005-11-18 07:27:53 +00:00
Chris Lattner
6b41edb30f
* Fix DerivedType::dropAllTypeUses to not change the number of types in a
...
type when it gets refined. This allows us to hash on this crucial value.
* Fix several issues in TypeMap::RefineAbstractType that prevent it from
handling hash values that change correctly.
* Define hashTypeStructure to not always return 0. :)
This last part (which depends on the first two) speeds up gccld time on eon
from 3.78s to 2.75s with a release build (a 28% speedup!). This resolves
PR474.
llvm-svn: 24372
2005-11-16 06:09:47 +00:00
Chris Lattner
7c727b2736
Fix handling of multiple unnamed globals with the same type
...
llvm-svn: 24362
2005-11-15 01:32:03 +00:00
Chris Lattner
0333e68f72
Add some dummy method impls
...
llvm-svn: 24345
2005-11-13 03:26:33 +00:00
Chris Lattner
06b453b2dc
Move some methods around. Refactor the parts of TypeMap that do not depend
...
on its template arguments into a base class so that the code isn't duplicated
5 times.
llvm-svn: 24343
2005-11-13 03:14:09 +00:00
Chris Lattner
5c28b96304
Split the type refinement case completely out of the type-becomes-concrete
...
case, simplifying the code.
llvm-svn: 24340
2005-11-13 01:58:06 +00:00
Chris Lattner
708bb251d8
Separate the type-became-concrete case from the type-is-resolved case, the
...
former of which takes much less work than the later. This speeds up linking
eon from 3.749 to 3.637s with a release build (about 3%).
llvm-svn: 24338
2005-11-13 01:27:50 +00:00
Chris Lattner
f2794fa073
Unswitch a loop, add more assertions, eliminate use of removeUserFromConcrete.
...
llvm-svn: 24324
2005-11-12 08:39:48 +00:00
Chris Lattner
11edcc19da
Tiny speedup, improve comments and code organization.
...
llvm-svn: 24323
2005-11-12 08:22:41 +00:00
Chris Lattner
4b96c540f6
print section info
...
llvm-svn: 24313
2005-11-12 00:10:19 +00:00
Andrew Lenharth
01aa56397d
continued readcyclecounter support
...
llvm-svn: 24300
2005-11-11 16:47:30 +00:00
Chris Lattner
ecc301df17
Fix the optimized code handling of user asm strings
...
llvm-svn: 24296
2005-11-10 23:24:26 +00:00
Chris Lattner
86164e6e9e
speedup the common case where nothing needs to be quoted
...
llvm-svn: 24294
2005-11-10 21:47:01 +00:00
Chris Lattner
e1d34bac0b
Allow per-character control over what target assemblers allow in symbol
...
names. This also changes the default to allow all of "$_." in addition
to letters and numbers as symbol names. If you don't want this, use
markCharUnacceptable to remove one of these or markCharAcceptable to add
to the set. This corresponds with what GAS accepts by default.
Also, this includes some minor speedups
llvm-svn: 24293
2005-11-10 21:40:01 +00:00
Chris Lattner
4b155fa5c3
Add a new option for targets that accept quoted labels.
...
llvm-svn: 24283
2005-11-10 19:30:07 +00:00
Chris Lattner
9fa3bcc8b4
remove the M instance var
...
llvm-svn: 24281
2005-11-10 19:02:18 +00:00
Chris Lattner
12b0831295
Make this more efficient of the common case where we are only mangling globals.
...
Do not mangle internal global names that do not collide with anything.
This gives us strings that now look like this:
__2E_str_1: ; '.str_1'
.asciz "foo"
instead of this:
l1__2E_str_1: ; '.str_1'
.asciz "foo"
llvm-svn: 24277
2005-11-10 18:48:58 +00:00
Chris Lattner
d7dbb856b9
Force packed vectors to be a power of two in length.
...
llvm-svn: 24264
2005-11-10 01:40:59 +00:00
Chris Lattner
f8a974d169
print alignment info for globals and functions
...
llvm-svn: 24212
2005-11-06 06:48:53 +00:00
Chris Lattner
79b8c79242
verify that alignments are always a power of 2
...
llvm-svn: 24200
2005-11-05 21:57:54 +00:00
Chris Lattner
7aeee3aff8
fix printing the alignment directive
...
llvm-svn: 24197
2005-11-05 21:20:34 +00:00
Nate Begeman
848622f87f
Add support alignment of allocation instructions.
...
Add support for specifying alignment and size of setjmp jmpbufs.
No targets currently do anything with this information, nor is it presrved
in the bytecode representation. That's coming up next.
llvm-svn: 24196
2005-11-05 09:21:28 +00:00
Chris Lattner
71d73eb411
Fix an iterator invalidation problem in code used by the -strip pass
...
llvm-svn: 24124
2005-10-31 18:42:37 +00:00
Chris Lattner
e3870fbe4a
Allow $
...
llvm-svn: 23721
2005-10-14 01:28:34 +00:00
Chris Lattner
20a244577d
add a hack to work around broken VC++ scoping rules. Thx to JeffC for pointing
...
this out to me
llvm-svn: 23655
2005-10-07 05:23:36 +00:00
Chris Lattner
3b793c6521
refactor a bit of code.
...
When moving constant entries in 'Map' if the entry is the representative
constant for the abstractypemap, make sure to update it as well. This
fixes the bcreader failures from last night on several C++ apps.
llvm-svn: 23628
2005-10-04 21:35:50 +00:00
Chris Lattner
dff59118c6
Minor speedup to avoid array searches given a Use*. This speeds up bc reading
...
of the python test from 1:00 to 54s.
llvm-svn: 23627
2005-10-04 18:47:09 +00:00
Chris Lattner
7a1450dbc6
Change the signature of replaceUsesOfWithOnConstant. The bool was always
...
true dynamically. Finally, pass the Use* that replaceAllUsesWith has into
the method for future use.
llvm-svn: 23626
2005-10-04 18:13:04 +00:00
Chris Lattner
935aa922e3
For large constants (e.g. arrays and structs with many elements) just
...
creating the keys and doing comparisons to index into 'Map' takes a lot
of time. For these large constants, keep an inverse map so that 'remove'
and move operations are much faster.
This speeds up a release build of the bc reader on Eric's nasty python
bytecode file from 1:39 to 1:00s.
llvm-svn: 23624
2005-10-04 17:48:46 +00:00
Chris Lattner
5bbf60a5b6
minor cleanup/fastpath for the bcreader. This speeds up the bcreader
...
from 1:41 -> 1:39 on the large python .bc file in a release build.
llvm-svn: 23623
2005-10-04 16:52:46 +00:00
Chris Lattner
8760ec73d8
implement the struct version of the array speedup, speeding up the
...
testcase a bit more from 1:48 -> 1.40.
llvm-svn: 23619
2005-10-04 01:17:50 +00:00
Chris Lattner
b64419ac40
Change ConstantArray::replaceUsesOfWithOnConstant to attempt to update
...
constant arrays in place instead of reallocating them and replaceAllUsesOf'ing
the result. This speeds up a release build of the bcreader from:
136.987u 120.866s 4:24.38
to
49.790u 49.890s 1:40.14
... a 2.6x speedup parsing a large python bc file.
llvm-svn: 23614
2005-10-03 22:51:37 +00:00
Chris Lattner
c4062ba65f
move some methods, no other changes
...
llvm-svn: 23613
2005-10-03 21:58:36 +00:00
Chris Lattner
0144fadc17
minor microoptimizations
...
llvm-svn: 23612
2005-10-03 21:56:24 +00:00
Chris Lattner
e7e139e8e8
Split SimpleConstantVal up into its components, so each Constant subclass getsa different enum value. This allows 'classof' for these to be really simple,not needing to call getType() anymore.
...
This speeds up isa/dyncast/etc for constants, and also makes them smaller.
For example, the text section of a release build of InstCombine.cpp shrinks
from 230037 bytes to 216363 bytes, a 6% reduction.
llvm-svn: 23467
2005-09-27 06:09:08 +00:00
Chris Lattner
cc9c03386f
Add support for a marker byte that indicates that we shouldn't add the user
...
prefix to a symbol name
llvm-svn: 23421
2005-09-24 08:24:28 +00:00
Jim Laskey
8ad8f71447
Move code dependency for MathExtras.h out of Constants.h.
...
llvm-svn: 22840
2005-08-17 20:06:22 +00:00
Jim Laskey
b74c666186
Culling out use of unions for converting FP to bits and vice versa.
...
llvm-svn: 22838
2005-08-17 19:34:49 +00:00
Andrew Lenharth
ed07233868
only build .a on alpha
...
llvm-svn: 22787
2005-08-14 15:14:34 +00:00
Andrew Lenharth
107a0a7690
Testing a variable before it is defined doesn't work so well. It is a fairly small thing, so just let everyone build the .a file
...
llvm-svn: 22783
2005-08-13 14:58:23 +00:00
Andrew Lenharth
6b62b479fa
Fix oversized GOT problem with gcc-4 on alpha
...
llvm-svn: 22777
2005-08-13 05:09:50 +00:00
Chris Lattner
e09bbc800c
Add a helper method
...
llvm-svn: 22768
2005-08-12 22:14:06 +00:00
Chris Lattner
24a0a43cb0
add new helper function
...
llvm-svn: 22698
2005-08-08 05:21:50 +00:00
Chris Lattner
6e709c1318
PHINode::hasConstantValue should never return the PHI itself, even if the
...
PHI is its only operand.
llvm-svn: 22676
2005-08-05 15:37:31 +00:00
Chris Lattner
1749aaa5e6
Fix an iterator invalidation problem when we decide a phi has a constant value
...
llvm-svn: 22675
2005-08-05 15:34:10 +00:00
Chris Lattner
37774affb1
Invoke instructions do not dominate all successors
...
llvm-svn: 22671
2005-08-05 01:03:27 +00:00
Chris Lattner
6f58350daf
Now that hasConstantValue is more careful w.r.t. returning values that only
...
dominate the PHI node, this code can go away. This also makes passes more
aggressive, e.g. implementing Transforms/CondProp/phisimplify2.ll
llvm-svn: 22670
2005-08-05 01:02:04 +00:00
Chris Lattner
bcd8d2c6e5
Use the bool argument to hasConstantValue to decide whether the client is
...
prepared to deal with return values that do not dominate the PHI. If we
cannot prove that the result dominates the PHI node, do not return it if
the client can't cope.
llvm-svn: 22669
2005-08-05 01:00:58 +00:00
Chris Lattner
1d8b24878f
Mark hasConstantValue as a const method
...
llvm-svn: 22666
2005-08-05 00:49:06 +00:00
Nate Begeman
0a94dec78a
Add an extra parameter that Chris requested
...
llvm-svn: 22665
2005-08-04 23:50:43 +00:00
Nate Begeman
b392321cae
Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
...
BasicBlock's removePredecessor routine. This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp
llvm-svn: 22664
2005-08-04 23:24:19 +00:00
Jeff Cohen
5f4ef3c5a8
Eliminate all remaining tabs and trailing spaces.
...
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Andrew Lenharth
9144ec4764
core changes for varargs
...
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Reid Spencer
294715b33e
Some cleanups for compilation with GCC 4.0.0 to remove warnings:
...
* Use C++ style casts, not C style casts
* Abstract base classes should have virtual destructor.
llvm-svn: 22057
2005-05-15 16:13:11 +00:00
Chris Lattner
2ad5aa8334
Verify that varargs functions all have ccc
...
llvm-svn: 21792
2005-05-08 22:27:09 +00:00
Chris Lattner
f7b6d3191b
add support for explicit calling conventions
...
llvm-svn: 21746
2005-05-06 20:26:43 +00:00
Chris Lattner
0603845a49
Add a 'tail' marker for call instructions, patch contributed by
...
Alexander Friedman.
llvm-svn: 21722
2005-05-06 05:51:46 +00:00
Andrew Lenharth
5e177826fd
Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
...
population (ctpop). Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.
More coming soon.
llvm-svn: 21676
2005-05-03 17:19:30 +00:00
Chris Lattner
c22333348e
fix a bug in the 1 index GEP handling code
...
llvm-svn: 21670
2005-05-03 16:44:45 +00:00
Chris Lattner
8298120f17
add direct support for making GEP instrs with one index
...
llvm-svn: 21665
2005-05-03 05:43:30 +00:00
Jeff Cohen
4e3aedeaa6
Use ANSI-approved way of getting the value infinity (otherwise VC++ won't compile it)
...
llvm-svn: 21662
2005-05-03 03:13:01 +00:00
Andrew Lenharth
c73e633a41
fold fp div by 0 to inf, the way gcc does. This is legal according to the FP spec
...
llvm-svn: 21655
2005-05-02 21:25:47 +00:00
Chris Lattner
1c636f1118
Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
...
llvm-svn: 21627
2005-04-30 03:44:07 +00:00
Chris Lattner
0a6f42ac1d
Unbreak the sparc backend.
...
llvm-svn: 21598
2005-04-27 18:57:15 +00:00
Chris Lattner
41d183ed8d
don't let Reid build void*'s :)
...
llvm-svn: 21571
2005-04-26 20:03:33 +00:00
Chris Lattner
e093c6f565
Make dominates(A,B) work with post dominators. Patch contributed by
...
Naveen Neelakantam, thanks!
llvm-svn: 21543
2005-04-25 20:50:33 +00:00
Reid Spencer
8edc8beacf
Older compilers won't like the inline virtual destructor in the header file
...
so we put the destructor in Pass.cpp and make it non-inline.
llvm-svn: 21520
2005-04-25 01:01:35 +00:00
Reid Spencer
9c47b25868
Shut GCC 4.0 up about classes with virtual functions but no virtual
...
destructor.
llvm-svn: 21510
2005-04-24 22:27:20 +00:00
Chris Lattner
2c7d177d25
Allow these methods to take a generic Value* to simplify clients. Use
...
const_cast instead of c casts.
llvm-svn: 21493
2005-04-24 07:28:37 +00:00
Chris Lattner
8a878ccb25
Fix a bug in my previous checkin
...
llvm-svn: 21485
2005-04-23 22:01:39 +00:00
Chris Lattner
6263766133
Add a method, remove last use of Type.def
...
llvm-svn: 21483
2005-04-23 22:00:09 +00:00
Jeff Cohen
82639853c0
Eliminate tabs and trailing spaces
...
llvm-svn: 21480
2005-04-23 21:38:35 +00:00
Misha Brukman
b1c9317bb4
Remove trailing whitespace
...
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
954c64d532
Improve doxygen, from part of Evan's patch that didn't apply.
...
llvm-svn: 21394
2005-04-21 16:06:03 +00:00
Chris Lattner
7ceb081f3f
Improve doxygen documentation, patch contributed by Evan Jones!
...
llvm-svn: 21393
2005-04-21 16:04:49 +00:00
Chris Lattner
9daef352e9
add an argument to allow avoiding deleting phi nodes.
...
llvm-svn: 21255
2005-04-12 18:52:14 +00:00
Andrew Lenharth
b442791124
First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
...
llvm-svn: 20900
2005-03-28 20:05:49 +00:00
Alkis Evlogimenos
9160d5fd8b
Add new function getPtrPtrFromArrayPtr().
...
llvm-svn: 20684
2005-03-19 11:40:31 +00:00
Misha Brukman
96eb878f2a
Convert tabs to spaces
...
llvm-svn: 20638
2005-03-16 05:42:00 +00:00
Chris Lattner
fb972add4f
stop using arg_front
...
llvm-svn: 20599
2005-03-15 05:03:36 +00:00
Chris Lattner
531f9e92d4
This mega patch converts us from using Function::a{iterator|begin|end} to
...
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
b1d901427a
correct the computation of the isAbstract bit for types.
...
llvm-svn: 20533
2005-03-09 17:34:27 +00:00
Reid Spencer
f064bb2617
Fix a typo in an assertion comment.
...
Patch contributed by Vladimir Merzliakov.
llvm-svn: 20529
2005-03-09 15:19:41 +00:00
Chris Lattner
86fe3a1fdb
rename insertEntry to insert
...
llvm-svn: 20484
2005-03-06 05:55:40 +00:00
Chris Lattner
533805e6da
Merge SymbolTable::removeEntry into SymbolTable::remove, its only caller
...
llvm-svn: 20483
2005-03-06 05:51:09 +00:00
Chris Lattner
290d881f84
Delete the really inefficient method: void remove(const Type* Typ);
...
Speed up the symbol stripping code by avoiding a linear search of the
type table.
Get rid of removeEntry(type_iterator), since 'remove' is exactly the same
operation.
llvm-svn: 20481
2005-03-06 05:46:41 +00:00
Chris Lattner
bad0e7e2d9
Remove some really gross and hard to understand code now that
...
InternallyInconsistent is always false.
llvm-svn: 20477
2005-03-06 05:21:40 +00:00
Chris Lattner
cd56f5a8e4
Simplify some code.
...
llvm-svn: 20476
2005-03-06 05:13:42 +00:00
Chris Lattner
eb9a12cbce
remove these methods.
...
llvm-svn: 20474
2005-03-06 02:37:47 +00:00
Chris Lattner
ffb3778f87
This fixes PR531, a crash when running the CBE on a bytecode file.
...
The problem is that Function::renameLocalSymbols is iterating through
the symbol table planes, occasionally calling setName to rename a value
(which used to do a symbol table remove/insert pair).
The problem is that if there is only a single value in a particular type
plane that the remove will nuke the symbol table plane, and the insert
will create and insert a new one. This hoses Function::renameLocalSymbols
because it has an iterator to the old plane, under the (very reasonable)
assumption that simply renaming a value won't cause the type plane to
disappear.
This patch fixes the bug by making the rename operation a single atomic
operation, which has a side effect of making the whole thing faster too. :)
llvm-svn: 20469
2005-03-06 02:14:28 +00:00
Chris Lattner
cdb9bfc150
remove all of the various setName implementations, consolidating them into
...
Value::setName, which is no longer virtual.
llvm-svn: 20464
2005-03-05 19:51:50 +00:00
Chris Lattner
f66165674f
2nd arg to setName goes away.
...
llvm-svn: 20460
2005-03-05 19:02:15 +00:00
Chris Lattner
cc77b84fcb
Constants never get names.
...
llvm-svn: 20459
2005-03-05 19:01:59 +00:00
Chris Lattner
ed2fb1cf93
Remove the 2nd argument to Value::setName
...
llvm-svn: 20458
2005-03-05 19:01:49 +00:00
Misha Brukman
f090d1b3ab
Fix the spelling of the word `the'
...
llvm-svn: 20412
2005-03-02 23:17:31 +00:00
Chris Lattner
4d8689edcb
Print the module ID as a comment.
...
llvm-svn: 20411
2005-03-02 23:12:40 +00:00
Chris Lattner
fe760deb75
Fix a nasty order of evaluation bug that Gabor Greif ran into. Here's an
...
explanation from IRC:
|sabre| I think it's an order of evaluation thing
|sabre| for me, the RHS of the assignment is evaluated first
|sabre| getTypeDescription checks to see if ConcreteTypeDescription[Ty] contains anything
|sabre| since it doesn't, it computes and returns the value
|sabre| this gets put into the map.
|sabre| For you, the LHS is evaluated first.
|sabre| Map[Ty] (aka ConcreteTypeDescriptions[Ty]) inserts an empty string into the map, returning a reference
|sabre| getTypeDesc then sees the empty string in the map
|sabre| and returns it
|sabre| bork :)
llvm-svn: 20394
2005-03-02 03:54:43 +00:00
Chris Lattner
1772c1a672
recognize llvm.prefetch. Patch contributed by Justin Wick!
...
llvm-svn: 20377
2005-02-28 19:28:00 +00:00