Chris Lattner
cbd34b2ae6
Now that all of the derived types have disciplined interfaces, we can eliminate
...
all of the ad-hoc storage of contained types. This allows getContainedType to
not be virtual, and allows us to entirely delete the TypeIterator class.
llvm-svn: 11230
2004-02-09 05:40:24 +00:00
Chris Lattner
ac6db755c3
Adjust to the changed StructType interface. In particular, getElementTypes() is gone.
...
llvm-svn: 11228
2004-02-09 04:37:31 +00:00
Chris Lattner
fa829be4d3
Start using the new and improve interface to FunctionType arguments
...
llvm-svn: 11224
2004-02-09 04:14:01 +00:00
Chris Lattner
2eaf58775e
Two problems with these lines of code:
...
1. The "work" was not in the assert, so it was punishing the optimized release
2. getNamedFunction is _very_ expensive in large programs. It is not designed
to be used like this, and was taking 7% of the execution time of the code
generator on perlbmk.
Since the assert "can never fail", I'm just killing it.
llvm-svn: 11214
2004-02-09 00:59:07 +00:00
Chris Lattner
5b6892e37c
Fix PR215: [bcwriter] Problem compactifying ConstantPointerRefs
...
Have I ever mentioned how much I _hate_ constantpointerrefs?
llvm-svn: 11212
2004-02-09 00:15:41 +00:00
Chris Lattner
85195147e1
vi failed me again. :)
...
llvm-svn: 11206
2004-02-08 21:52:30 +00:00
Chris Lattner
144f0efd4c
Rename the invoke 'except' destination to the 'unwind' destination
...
llvm-svn: 11205
2004-02-08 21:52:04 +00:00
Chris Lattner
fae8ab3088
rename the "exceptional" destination of an invoke instruction to the 'unwind' dest
...
llvm-svn: 11202
2004-02-08 21:44:31 +00:00
Chris Lattner
bb5f0db8d6
Adjust to the new BB ctor
...
llvm-svn: 11113
2004-02-04 03:57:50 +00:00
Chris Lattner
9cda4bf8e5
When splitting a basic block, insert the new half immediately after the first
...
half.
llvm-svn: 11110
2004-02-04 03:21:31 +00:00
Chris Lattner
d8a232b716
If changing a parent, don't add then remove the object from the leak detector
...
llvm-svn: 11106
2004-02-04 01:06:38 +00:00
Chris Lattner
c4c7ea5288
In BasicBlock::splitBasicBlock, just use islist::splice to move the instructions,
...
instead of a loop that is really inefficient with large basic blocks.
This speeds up the inliner pass on the testcase in PR209 from 13.8s to 2.24s
which still isn't exactly speedy, but is a lot better. :)
llvm-svn: 11105
2004-02-03 23:11:21 +00:00
Chris Lattner
bcade4b8e6
Floating point negates are -0.0 - X, not 0.0 - X
...
llvm-svn: 11084
2004-02-02 20:21:29 +00:00
Chris Lattner
ac80ea4970
Second half of a fix for PR218 & test/Regression/Assembler/2004-02-01-NegativeZero.llx.
...
Basically we store floating point values as their integral components, instead of relying
on the semantics of floating point < to differentiate between values. This is likely to
make the map search be faster anyway.
llvm-svn: 11064
2004-02-01 22:49:04 +00:00
Chris Lattner
125ed54fdc
Fix a crasher bug in my constant folding rewrite
...
llvm-svn: 11044
2004-02-01 01:23:19 +00:00
Chris Lattner
241ed4c500
Fix a problem brian ran into with the bytecode reader asserting. It turns
...
out that the problem was actually the writer writing out a 'null' value
because it didn't normalize it. This fixes:
test/Regression/Assembler/2004-01-22-FloatNormalization.ll
llvm-svn: 10967
2004-01-23 00:55:21 +00:00
Misha Brukman
2cbec5de52
Let subclasses implement ModuleProvider::materializeModule() which is based on
...
their implementation of book-keeping for which functions need to be materialized
and which don't.
llvm-svn: 10943
2004-01-21 22:54:50 +00:00
Chris Lattner
c70b3f63cc
SlotCalculator.h moved
...
llvm-svn: 10931
2004-01-20 19:50:34 +00:00
Chris Lattner
083c99e347
Major changes. Now we only compactify individual type planes if it is in
...
fact "profitable" to do so. This makes compactification "free" for small
programs (ie, it is completely disabled) and even helps large programs by
not having to encode pointless compactification planes.
On 176.gcc, this saves 50K from the bytecode file, which is, alas only
a couple percent.
This concludes my head bashing against the bytecode format, at least for
now.
llvm-svn: 10922
2004-01-20 00:57:32 +00:00
Chris Lattner
ca1f8afe85
Add support for building the compactiontable for bytecode files. This shrinks
...
the bytecode file for 176.gcc by about 200K (10%), and 254.gap by about 167K,
a 25% reduction. There is still a lot of room for improvement in the encoding
of the compaction table.
llvm-svn: 10913
2004-01-18 21:07:07 +00:00
Chris Lattner
f78819d9ad
Eliminate special case handling for CPR's
...
Fix some problem cases where I was building the slot calculator in bytecode
writer mode instead of asmwriter mode.
llvm-svn: 10911
2004-01-18 21:03:06 +00:00
Chris Lattner
677af4a1cb
Bytecode format for LLVM 1.2 no longer explicitly encodes zeros in primitive
...
type planes. This saves about 5k on 176.gcc, and is needed for a subsequent
patch of mine I'm working on.
llvm-svn: 10908
2004-01-17 23:25:43 +00:00
Chris Lattner
2d0e6f6326
Cleanups & efficiency improvements
...
llvm-svn: 10888
2004-01-15 20:24:09 +00:00
Chris Lattner
21699e8f55
The bcwriter does not want ConstantPointerRef's to be indexed, and the asmwriter never did!
...
llvm-svn: 10885
2004-01-15 18:47:15 +00:00
Chris Lattner
de36304453
When emitting bytecode, handle strings specially. Do not add the characters
...
that make up the strings to the slotcalculator.
llvm-svn: 10862
2004-01-14 23:34:39 +00:00
Chris Lattner
2d6902b4b6
Hrm, apparently I missed lowering this intrinsic. :(
...
llvm-svn: 10858
2004-01-14 20:41:29 +00:00
Chris Lattner
e8701f690f
Fix bug in previous checkin: Demorgan would be ashamed of me, I need to
...
lay off the crack.
llvm-svn: 10855
2004-01-14 17:51:53 +00:00
Chris Lattner
e8dfccaabd
Implement ConstantArray::isString
...
llvm-svn: 10851
2004-01-14 17:06:38 +00:00
Chris Lattner
02062823f7
Fix check. PHI nodes must be handled specially, of course.
...
llvm-svn: 10842
2004-01-14 05:42:52 +00:00
Chris Lattner
ec5089a223
Tighten up verifier checks. The result of an invoke instruction only
...
dominates the normal destination, not the exceptional dest (ie, the result
of a call is undefined on an exception)
llvm-svn: 10841
2004-01-14 04:25:59 +00:00
Chris Lattner
6089bb1f19
The only clients of the slot calculator are now the asmwriter and bcwriter.
...
Since this really only makes sense for these two, change hte instance variable
to reflect whether we are writing a bytecode file or not. This makes it
reasonable to add bcwriter specific stuff to it as necessary.
llvm-svn: 10837
2004-01-14 02:49:34 +00:00
Chris Lattner
061da2f059
Implement a bunch of symbolic constant folding opportunities. This implements
...
testcase test/Regression/Assembler/ConstantExprFold.llx
Note that these kinds of things only rarely show up in source code, but are
exceedingly common in the intermediate stages of algorithms like SCCP. By
folding things (especially relational operators) that use symbolic constants,
we are able to speculatively fold more conditional branches, which can
lead to some big simplifications.
It would be easy to add a lot more special cases here, so if you notice
SCCP missing anything "obvious", you know what to make smarter. :)
llvm-svn: 10812
2004-01-13 05:51:55 +00:00
Chris Lattner
dab8b6bb50
Implement new Instruction::isRelational method
...
llvm-svn: 10810
2004-01-12 23:18:25 +00:00
Chris Lattner
1dd054c41b
Rearrange and comment code better. No functionality changes
...
llvm-svn: 10808
2004-01-12 22:07:24 +00:00
Chris Lattner
5a945e3616
Rename ConstantHandling.* -> ConstantFolding.*
...
Move a bunch of (now) private stuff from ConstantFolding.h into
ConstantFolding.cpp.
This _finally_ gets us to a place where we have a sane constant folder. The
rules are:
1. LLVM clients now use ConstantExpr::get* methods to fold constants. If they
cannot be folded, a constantexpr is created, so these methods always return
valid Constant*'s.
2. The implementation of ConstantExpr::get* uses the functions exposed by
ConstantFolding.h to try to fold constants. If they cannot be folded,
they should return a null pointer.
3. The implementation of ConstantFolding can do whatever it wants, and only
has one client (Constants.cpp)
This cuts down on the wierd dependencies, and eliminates the two interfaces.
The old constanthandling interface was especially bad for clients to use
because almost none of them took the failure condition into consideration,
thus leading to obscure problems.
llvm-svn: 10807
2004-01-12 21:13:12 +00:00
Chris Lattner
6ff6ceaf75
Remove a whole bunch more ugliness. This is actually getting to the point of
...
this whole refactoring: allow constant folding methods to return something
other than predefined classes, allow them to return generic Constant*'s.
llvm-svn: 10806
2004-01-12 21:02:29 +00:00
Chris Lattner
2361bd02a1
Move ConstantHandling.h into lib/VMCore and out of include/llvm
...
llvm-svn: 10805
2004-01-12 20:48:11 +00:00
Chris Lattner
e4867d75dd
Move this file to lib/VMCore
...
llvm-svn: 10804
2004-01-12 20:47:29 +00:00
Chris Lattner
f8348c3549
Eliminate usage of the wierd overloaded operator constant folders
...
llvm-svn: 10802
2004-01-12 20:41:05 +00:00
Chris Lattner
0bba771f49
Eliminate ConstantFoldShiftInstruction reference
...
llvm-svn: 10801
2004-01-12 20:40:42 +00:00
Chris Lattner
9eb2b527ad
Fix out of date comment, remove use of ConstantExpr::getShift
...
llvm-svn: 10794
2004-01-12 19:12:58 +00:00
Chris Lattner
5645e8a82d
Make ConstantExpr::get work for shifts as well
...
llvm-svn: 10790
2004-01-12 19:04:55 +00:00
Chris Lattner
0df14b3f2b
Move llvm::ConstantFoldInstruction from here to Transforms/Utils
...
llvm-svn: 10784
2004-01-12 18:25:03 +00:00
Chris Lattner
aacf2a5833
Implement: Assembler/2004-01-11-getelementptrfolding.llx
...
llvm-svn: 10759
2004-01-11 23:56:33 +00:00
Chris Lattner
d248950a8f
Urg, remove testing code.
...
llvm-svn: 10757
2004-01-11 23:30:03 +00:00
Chris Lattner
0180590bea
Fix a regression that I introduced yesterday. :(
...
llvm-svn: 10756
2004-01-11 23:29:26 +00:00
Chris Lattner
65f901e23b
Check in two changes:
...
The first change (which is disabled) compactifies all of the function constant
pools into the global constant pool, in an attempt to reduce the amount of
duplication and overhead. Unfortunately, as the comment indicates, this is
not yet a win, so it is disabled.
The second change sorts the typeid's so that those types that can be used
by instructions in the program appear earlier in the table than those that
cannot (such as structures and arrays). This causes the instructions to
be able to use the dense encoding more often, saving about 5K on 254.gap.
This is only a .65% savings though, unfortunately. :(
llvm-svn: 10754
2004-01-10 23:46:13 +00:00
Chris Lattner
570c69ce01
Hrm, another minor cleanup, which I missed before
...
llvm-svn: 10753
2004-01-10 21:42:24 +00:00
Chris Lattner
03c71fa8c5
Minor cleanup
...
llvm-svn: 10752
2004-01-10 21:40:29 +00:00
Chris Lattner
59f1ef40b0
Add support for new intrinsic
...
llvm-svn: 10701
2004-01-06 05:33:02 +00:00
Chris Lattner
3d903f0c0b
Add VMCore and code generator support for debugging intrinsics. By default
...
code generators completely ignore them.
llvm-svn: 10691
2004-01-05 05:36:30 +00:00
Chris Lattner
09bd1a06c1
Add some comments, add new getGlobalVariable method
...
llvm-svn: 10671
2003-12-31 08:43:01 +00:00
Chris Lattner
be3596c8ca
* Make Module::getTypeName const
...
* Add new Module::getTypeByName method
* Group methods in Module.cpp better
llvm-svn: 10668
2003-12-31 07:09:33 +00:00
Chris Lattner
efeb39e3c0
Make the lookup method const.
...
llvm-svn: 10667
2003-12-31 07:08:19 +00:00
Chris Lattner
eb537b2401
Fix PR198
...
llvm-svn: 10659
2003-12-31 03:19:37 +00:00
Chris Lattner
af3f8f3b42
Add comments
...
llvm-svn: 10658
2003-12-31 02:50:02 +00:00
Chris Lattner
5d236005b0
Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
...
implementation from the TargetMachine directly.
llvm-svn: 10636
2003-12-28 21:23:38 +00:00
Chris Lattner
24650d2b5e
Move into the VMCore library
...
llvm-svn: 10623
2003-12-28 08:30:20 +00:00
Chris Lattner
d1ea9cd345
The recalclulate method was a nasty hack that was once used by the -cee pass,
...
which never worked itself. The cee pass still doesn't work, but it doesn't use
this method anymore anyway, so eliminate the method.
llvm-svn: 10302
2003-12-07 00:55:32 +00:00
Chris Lattner
00f5167693
Completely rewrite domset, idom, and domtree implementation. Now it is based
...
on the algorithm for directly computing immediate dominators presented in this
paper:
A Fast Algorithm for Finding Dominators in a Flowgraph
T. Lengauer & R. Tarjan, ACM TOPLAS July 1979, pgs 121-141.
This _substantially_ speeds up construction of all dominator related information.
Post-dominators to follow.
llvm-svn: 10301
2003-12-07 00:38:08 +00:00
Chris Lattner
f5569bb9a5
Fix const correctness
...
llvm-svn: 10229
2003-11-25 21:28:00 +00:00
Chris Lattner
ad70d4a15b
Relax constrains on GEP type indexes
...
llvm-svn: 10228
2003-11-25 21:21:46 +00:00
Chris Lattner
3ae303cc8c
Check return types of functions
...
llvm-svn: 10146
2003-11-21 22:32:23 +00:00
Chris Lattner
dcdc371522
Fix problem Reid was having with external globals and nonexternal linkage
...
llvm-svn: 10133
2003-11-21 20:33:27 +00:00
Chris Lattner
189d19fb04
Finegrainify namespacification
...
llvm-svn: 10131
2003-11-21 20:23:48 +00:00
Chris Lattner
7e5e456d96
Fix some problems with assertions printing
...
llvm-svn: 10129
2003-11-21 17:35:51 +00:00
Chris Lattner
9d72c2f229
improve error message
...
llvm-svn: 10128
2003-11-21 17:06:29 +00:00
Chris Lattner
a29600046d
Minor cleanups and simplifications
...
llvm-svn: 10127
2003-11-21 16:52:05 +00:00
Chris Lattner
2af517281d
Start using the nicer terminator auto-insertion API
...
llvm-svn: 10111
2003-11-20 18:25:24 +00:00
Chris Lattner
9ab47d1625
Somehow I forgot poor little UnwindInst
...
*sniff*
llvm-svn: 10108
2003-11-20 18:11:56 +00:00
Chris Lattner
0e03ab67c3
* Finegrainify namespacification
...
* Add new constructors to allow insertion of terminator instructions at the
end of basic blocks.
* Move a ReturnInst method out-of-line, so that the vtable and type info don't
need to be emitted to every translation unit that uses the class.
llvm-svn: 10107
2003-11-20 17:45:12 +00:00
Chris Lattner
2447ef59c4
Don't crash if we are printing an orphaned basic block!
...
llvm-svn: 10100
2003-11-20 00:09:43 +00:00
Chris Lattner
45cfe54683
Really, there was a reason for me factoring that out
...
llvm-svn: 10089
2003-11-19 19:20:20 +00:00
Chris Lattner
1a02ca932c
*** Significantly speed up type resultion
...
This change speeds up type resolution by checking to see if a type is
recursive, and if it's not, using a more efficient algorithm.
This dramatically reduces bytecode loading time of kc++, reducing time-to-jit
kc++ --version to 17s from 33s
llvm-svn: 10088
2003-11-19 19:10:23 +00:00
Chris Lattner
a11f78167b
Finegrainify namespacification
...
llvm-svn: 10080
2003-11-19 06:14:38 +00:00
Chris Lattner
74c55dd4f9
Fix PR130, and testcase test/Regression/Linker/2003-11-18-TypeResolution.ll
...
llvm-svn: 10075
2003-11-19 01:02:52 +00:00
Chris Lattner
dc2e39191a
Implement == and != correctly. Before they would incorrectly return !=
...
for some constant exprs when they could really be the same value
llvm-svn: 10058
2003-11-17 20:19:35 +00:00
Chris Lattner
e120a73166
The ConstantPointer class is now gone.
...
llvm-svn: 10057
2003-11-17 19:47:21 +00:00
Chris Lattner
77f20dc13f
No REALLY, get rid of ConstantPointer references
...
llvm-svn: 10054
2003-11-17 19:21:04 +00:00
Chris Lattner
4b6addf98a
Eliminate use of the ConstantPointer class
...
llvm-svn: 10053
2003-11-17 19:19:32 +00:00
Chris Lattner
9d9cbcf246
Constant folding shalt not be built on annotations
...
llvm-svn: 10052
2003-11-17 19:05:17 +00:00
Chris Lattner
c96e96b26d
Be a bit more tolerant of broken code
...
llvm-svn: 10050
2003-11-17 01:17:04 +00:00
Brian Gaeke
fda1f1835b
When you hand WriteAsOperand a type, it now prints out its symbolic name.
...
llvm-svn: 10042
2003-11-16 23:08:27 +00:00
Brian Gaeke
9f47927b28
When failing a Verifier assertion, use WriteAsOperand to print out the
...
offending types and/or values.
llvm-svn: 10041
2003-11-16 23:07:42 +00:00
Chris Lattner
00211f1d80
Don't print 'No predecessors!' on the entry block
...
llvm-svn: 10038
2003-11-16 22:59:57 +00:00
Chris Lattner
ef901291c6
Expose the verifier to opt
...
llvm-svn: 9984
2003-11-13 19:47:29 +00:00
Chris Lattner
3b93c91836
Detect problems with PHI node operands!
...
llvm-svn: 9916
2003-11-12 07:13:37 +00:00
Brian Gaeke
960707c335
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
a570f7b681
Fix PR95. I'm checking this patch in for Reid Spencer, who figured it out
...
and wrote it up. Thanks!!
llvm-svn: 9832
2003-11-09 19:39:48 +00:00
Chris Lattner
da8571b464
Add an assertion
...
llvm-svn: 9831
2003-11-09 15:51:07 +00:00
Chris Lattner
b36e8a1a2e
Add support for constant expr shifts
...
llvm-svn: 9735
2003-11-05 19:53:03 +00:00
Chris Lattner
e225507193
If we're not checking, don't check!
...
llvm-svn: 9732
2003-11-05 19:09:40 +00:00
Chris Lattner
41baa98478
Make code gcc 3.4 clean
...
llvm-svn: 9719
2003-11-05 05:15:42 +00:00
Chris Lattner
7c18b18c46
Fix InstCombine/2003-11-03-VarargsCallBug.ll
...
llvm-svn: 9681
2003-11-03 18:44:58 +00:00
Chris Lattner
9157ec025b
Did I mention that I _HATE_ CPRs?
...
llvm-svn: 9639
2003-10-31 18:38:06 +00:00
Chris Lattner
f6925da295
Constant pointer refs are causing these to fail unnecessarily, which is causing
...
a lot of code to be pessimized. I hate CPRs. :(
llvm-svn: 9635
2003-10-31 17:51:16 +00:00
Alkis Evlogimenos
6029d4032c
Use already existing classes for post order iterator.
...
llvm-svn: 9629
2003-10-31 03:02:34 +00:00
Chris Lattner
8339f7d379
Make use of the new AssemblyAnnotationWriter interface
...
llvm-svn: 9619
2003-10-30 23:41:03 +00:00
Alkis Evlogimenos
5a320efd3b
Output types in reverse postorder. This will allow the ByteCode/Reader
...
to create the minimum number of opaque types for each type with a
cycle in its type graph.
llvm-svn: 9615
2003-10-30 21:04:44 +00:00
Chris Lattner
f14ead9210
Print the names of more opaque types
...
llvm-svn: 9598
2003-10-30 00:22:33 +00:00
Chris Lattner
92d60539c8
Make sure to print opaque types names if they are available.
...
llvm-svn: 9597
2003-10-30 00:12:51 +00:00
Alkis Evlogimenos
d478d3d19c
Add more debugging info to help tracing the SlotCalculator.
...
llvm-svn: 9575
2003-10-29 03:12:12 +00:00
Chris Lattner
8a55262c76
Fix bug: instcombine/2003-10-23-InstcombineNullFail.ll
...
llvm-svn: 9403
2003-10-23 05:21:48 +00:00
Chris Lattner
2c35b1c94c
Make sure to add a type for va_next operands, which may not other wise
...
occur in the module
llvm-svn: 9336
2003-10-21 17:40:54 +00:00
Chris Lattner
7267b352fb
Fix problem which effected linking apache
...
llvm-svn: 9335
2003-10-21 17:39:59 +00:00
John Criswell
29265fe981
Added LLVM copyright header.
...
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell
4436c49787
Added LLVM copyright notice to Makefiles.
...
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
482202a601
Added LLVM project notice to the top of every C++ source file.
...
Header files will be on the way.
llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
d77dd78c52
"Function"[0] == 'F', not 'M'
...
llvm-svn: 9297
2003-10-20 19:10:06 +00:00
Chris Lattner
b94550e537
Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
...
llvm-svn: 9269
2003-10-19 21:34:28 +00:00
Chris Lattner
5b33748497
Add support for the new varargs intrinsics and instructions
...
llvm-svn: 9226
2003-10-18 05:57:43 +00:00
Misha Brukman
e5a2565b91
Chris says it's better to assert that TheModule is valid than silently return 0.
...
llvm-svn: 9212
2003-10-17 21:59:57 +00:00
Misha Brukman
de360f88c8
Return the Module that we just materialized.
...
llvm-svn: 9201
2003-10-17 18:27:13 +00:00
Alkis Evlogimenos
8faf8d93d5
Eliminate some extraneous code in SlotCalculator::insertVal().
...
Rename SlotCalculator::getValSlot() to SlotCalculator::getSlot(),
SlotCalculator::insertValue() to SlotCalculator::getOrCreateSlot(),
SlotCalculator::insertVal() to SlotCalculator::insertValue(), and
SlotCalculator::doInsertVal() to SlotCalculator::doInsertValue().
llvm-svn: 9190
2003-10-17 02:02:40 +00:00
Chris Lattner
068ad84038
Add support for 'weak' linkage.
...
llvm-svn: 9171
2003-10-16 18:29:00 +00:00
Chris Lattner
079edeb919
Completely rewrite support for the Value::use_* list. Now, all operations on
...
this list (except use_size()) are constant time. Before the killUse method
(used whenever something stopped using a value) was linear time, and thus
very very slow for large programs.
This speeds GCCAS up _substantially_ on large programs: almost 2x for 176.gcc:
176.gcc: 77.07s -> 37.38s
177.mesa: 7.59s -> 5.57s
252.eon: 21.02s -> 19.52s (*)
253.perlbmk: 11.40s -> 13.05s
254.gap: 7.25s -> 7.42s
252.eon would speed up a whole lot more, but optimization time is being
dominated by the inlining pass, which needs to be fixed.
llvm-svn: 9160
2003-10-16 16:53:07 +00:00
Misha Brukman
56a8642a42
Enabling incremental bytecode loading in the JIT:
...
* FunctionPassManager ctor now takes in a ModuleProvider
* run() materializes function before running passes on it
llvm-svn: 9126
2003-10-14 21:38:42 +00:00
Chris Lattner
0c068c097a
Stop using "reverse depth first" order
...
llvm-svn: 9081
2003-10-13 15:21:58 +00:00
Chris Lattner
e859403772
Speed up TypesEqual by specializing it for all of the derived types, avoiding
...
a lot of virtual method dispatch overhead.
llvm-svn: 9078
2003-10-13 14:55:56 +00:00
Chris Lattner
1dc3f3fdc0
Avoid creating lots of pointless opaque types, with short lifetimes
...
llvm-svn: 9076
2003-10-13 14:03:36 +00:00
Chris Lattner
c7bc3bb503
This is a header file, hear me roar
...
llvm-svn: 9075
2003-10-13 05:34:24 +00:00
Chris Lattner
ab16a659d7
* Remove extraneous #includes
...
* Fix a nasty initializer ordering bug. Any only-CFG passes which registered
themselves before the CFGOnlyAnalysis vector initialized got forgotten and
thus got invalidated and recomputed.
In particular, in my compiled version of gccas, the Loop information pass was
being recomputed unnecessarily.
llvm-svn: 9074
2003-10-13 05:33:01 +00:00
Chris Lattner
44d2c3514a
Regularize header file comments
...
llvm-svn: 9071
2003-10-13 03:32:08 +00:00
Chris Lattner
dd99f5bf8f
Rename method
...
llvm-svn: 9055
2003-10-12 18:52:12 +00:00
Brian Gaeke
cc31fddf13
Don't include Config/stdio.h or <stdio.h>.
...
llvm-svn: 9031
2003-10-10 18:46:29 +00:00
Misha Brukman
fa100531e1
Fix spelling/grammar.
...
llvm-svn: 9023
2003-10-10 17:54:14 +00:00
Chris Lattner
815ae2bfe3
Add a sanity check for constant expression casts
...
llvm-svn: 8951
2003-10-07 22:19:19 +00:00
Chris Lattner
794a7490f8
Users can never be null
...
llvm-svn: 8895
2003-10-06 17:33:39 +00:00
Chris Lattner
df9779c5c2
Be more careful handling PHI nodes, which might be of potentially high degree.
...
This reduces the time to verify a function from eon with a large number of
large PHI nodes from 22996s (6.38 hours) to 10.5499s
llvm-svn: 8866
2003-10-05 17:44:18 +00:00
Chris Lattner
b50d135710
Type tables are now AbstractTypeUsers. This allows them to merge together
...
constants as necessary due to type resolution. With this change, the
following spec benchmarks now link: 176.gcc, 177.mesa, 252.eon,
253.perlbmk, & 300.twolf. IOW, all SPEC INT and FP benchmarks now link.
llvm-svn: 8853
2003-10-05 00:17:43 +00:00
Chris Lattner
cc593fb6c6
Rename AbstractModuleProvider -> ModuleProvider, to match the header file name,
...
and because, while the class used by the interface is abstract, the actual
concept is not.
llvm-svn: 8850
2003-10-04 20:14:59 +00:00
Chris Lattner
3e88ef9f93
Minor random speedup: make Constant::getNullValue only call ConstantFOO::get
...
once!
llvm-svn: 8845
2003-10-03 19:34:51 +00:00
Chris Lattner
2c6cecf321
Explicit copy ctors are no longer needed
...
llvm-svn: 8844
2003-10-03 19:02:41 +00:00
Chris Lattner
7f4cfda3ba
Minor cleanups
...
llvm-svn: 8843
2003-10-03 18:57:54 +00:00
Chris Lattner
0f21ab75fa
This checkin basically amounts to a complete rewrite of the type-resolution
...
machinery. This dramatically simplifies how things works, removes irritating
little corner cases, and overall improves speed and reliability.
Highlights of this change are:
1. The exponential algorithm built into the code is now gone. For example
the time to disassemble one bytecode file from the mesa benchmark went
from taking 12.5s to taking 0.16s.
2. The linker bugs should be dramatically reduced. The one remaining bug
has to do with constant handling, which I actually introduced in
"union-find" checkins.
3. The code is much easier to follow, as a result of fewer special cases.
It's probably also smaller. yaay.
llvm-svn: 8842
2003-10-03 18:46:24 +00:00
Chris Lattner
29dc65a324
These methods are dead, remove them. Because the bodies will soon be
...
ressurected, just ifdef them out for now.
llvm-svn: 8840
2003-10-03 18:39:57 +00:00
Chris Lattner
a72b78967f
Dramatically simplify DerivedType::refineAbstractTypeToInternal
...
This makes use of the new PATypeHolder's to keep types from being deleted
prematurely, instead of the wierd "self reference" garbage. This is easier
to understand and more efficient as well.
llvm-svn: 8834
2003-10-03 04:48:21 +00:00
Chris Lattner
016418b8c2
Make the PATypeHolder use a simple union-find implementation to handle
...
merging of types. This makes it MUCH more efficient than before, also
making things simpler.
llvm-svn: 8833
2003-10-02 23:35:57 +00:00
Chris Lattner
22e4ca8863
There is no reason for Value to be an AbstractTypeUser. This just makes things
...
significantly more complete. Instead, just make DerivedType's AbstractTypeUser's,
and make Value contain a PATypeHolder.
llvm-svn: 8828
2003-10-02 19:44:40 +00:00
Chris Lattner
64d88bc788
Do not use BasicBlock::succ_iterator
...
llvm-svn: 8700
2003-09-24 22:03:22 +00:00
Misha Brukman
cd1d0e31f5
* No longer initialize the module, a subclass is more suitable to do this
...
because it can add a module ID which we do not have at this time.
* Check to see if the module has been initialized when materializing it.
llvm-svn: 8674
2003-09-22 23:44:13 +00:00
Chris Lattner
5dac64f629
Rename Function::getEntryNode -> getEntryBlock
...
llvm-svn: 8625
2003-09-20 14:39:18 +00:00
Chris Lattner
3284ed725a
Reject "llvm." as a function name
...
llvm-svn: 8608
2003-09-19 19:31:41 +00:00
Misha Brukman
3d72faddeb
Minimal implementation of the abstract ModuleProvider interface.
...
llvm-svn: 8594
2003-09-18 16:17:06 +00:00
Chris Lattner
c1b1651210
Change the semancics of the dropallrefs method
...
llvm-svn: 8572
2003-09-17 04:58:59 +00:00
Chris Lattner
bb9d03b9c0
Renamed DominatorTree::Node::getNode() -> getBlock()
...
llvm-svn: 8469
2003-09-11 16:26:13 +00:00
Chris Lattner
630d2954be
Rework dominator interfaces to handle changes in the post-dominance
...
construction. Now there may be multiple root blocks, and null is a
special node used to mark the "virtual" exit node of a CFG.
llvm-svn: 8461
2003-09-10 20:37:51 +00:00
Brian Gaeke
ff713ae819
Make createVerifierPass return a FunctionPass *.
...
llvm-svn: 8449
2003-09-10 19:37:04 +00:00
Chris Lattner
216c7b8aed
Fix spell-o's
...
llvm-svn: 8431
2003-09-10 05:29:43 +00:00
John Criswell
f711d34e98
Reverting back to the previous revision.
...
We want to check for length 5 because we might get the "llvm." string as the
name. That string is in the LLVM namespace and should be checked as such.
We also don't have to worry about garbage data because (I believe) the string
class will return a valid value. So, the switch statement will work and we
don't have to worry about the code wandering into segfault land.
llvm-svn: 8419
2003-09-09 16:58:41 +00:00
John Criswell
8d575cb2e1
Modified the check for intrinsic functions. All intrinsic functions have to
...
be at least 6 characters, since something must follow the "llvm." string in the
function name.
This seems to fix an assertion failure with the SingleSource tests, too.
llvm-svn: 8418
2003-09-09 16:36:09 +00:00
Chris Lattner
04ecefe232
Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
...
llvm-svn: 8411
2003-09-08 19:44:26 +00:00
Chris Lattner
66d5f575ba
Add support for unwind
...
llvm-svn: 8407
2003-09-08 18:54:36 +00:00
Chris Lattner
504f9242c3
Add support for volatile loads/stores
...
llvm-svn: 8393
2003-09-08 17:45:59 +00:00
Misha Brukman
730e047678
Spell `occurrence' correctly.
...
llvm-svn: 8388
2003-09-08 03:08:43 +00:00
Chris Lattner
20b98d2c93
Add asserts, move code around. This gets the dropAllTypeUses partially implemented
...
llvm-svn: 8361
2003-09-05 05:10:04 +00:00
Chris Lattner
d15598bfe0
Move functionality preserving changes.
...
Inline containsEquivalent
Remove some //'s
llvm-svn: 8358
2003-09-05 02:39:52 +00:00
Chris Lattner
5ac07d2221
Refactor what has effectively become copy-and-pasted code
...
llvm-svn: 8357
2003-09-05 02:30:47 +00:00
Chris Lattner
3f695ff02e
Check in a bunch of minor fixes, plus a whole lot of #if 0'd out code, which will hopefully be enabled in the near future
...
This does not make any functionality changes
llvm-svn: 8355
2003-09-05 02:21:39 +00:00
Chris Lattner
e4fdce4235
containsEquivalent never returns its argument
...
llvm-svn: 8353
2003-09-04 23:49:53 +00:00
Chris Lattner
cd27235b23
Remove needless usage of getDescription()
...
llvm-svn: 8351
2003-09-04 23:46:03 +00:00
Chris Lattner
59be7695ef
Inline method
...
llvm-svn: 8350
2003-09-04 23:43:40 +00:00
Chris Lattner
b8b10b5c54
Don't try to be sneaky, breaking recursive types in the process
...
llvm-svn: 8348
2003-09-04 23:41:03 +00:00
Chris Lattner
50745187ef
This is now unnecessary
...
llvm-svn: 8347
2003-09-04 23:38:22 +00:00
Chris Lattner
13651f0c46
Fix bug where we couldn't print a function without a name
...
llvm-svn: 8341
2003-09-03 17:56:43 +00:00
Chris Lattner
b89d2afab1
No need to rescan types when they are created.
...
llvm-svn: 8339
2003-09-03 14:44:53 +00:00
Chris Lattner
cc61a136f7
Another small speedup, this one to: 2.42s
...
llvm-svn: 8335
2003-09-02 22:52:49 +00:00
Chris Lattner
188afa5feb
Don't return bogus references, and don't add an entry to the Concrete map
...
unless it's not empty!
llvm-svn: 8334
2003-09-02 22:50:02 +00:00
Chris Lattner
39e5095c8e
Another optimization, speed up the testcase to 2.7s
...
llvm-svn: 8333
2003-09-02 22:15:15 +00:00
Chris Lattner
835499277b
Removal of explicit stack, which requires the method to be a member (so it can
...
call setAbstract). Now that we just compute abstractness we can also return
the computed value by value instead of as an argument.
llvm-svn: 8332
2003-09-02 21:56:34 +00:00
Chris Lattner
9a61bbf1d3
Remove the "recursive bit", not only is it unused by anyone, it was also
...
not correctly calculated, and calculating it wrong for fun seems rather
pointless. This also speeds up my favorite testcase by .25 seconds.
llvm-svn: 8330
2003-09-02 21:41:05 +00:00
Chris Lattner
ce35f14050
Don't bother doing an exhaustive recursive walk if we are at the limit of what
...
we need to know anyway. This reduces the 2002-07-08-HugePerformanceProblem.llx
down to 3.210u:0.010s, which is back in the acceptable range again
llvm-svn: 8323
2003-09-02 20:06:29 +00:00
Chris Lattner
99b9ddead7
Ugh, fix bugs. Ok, so the last fix wasn't as great as I thought it was.
...
Now we're back to: 131.730u, 0.330s, which is still quite an improvement,
but still quite unacceptable
llvm-svn: 8322
2003-09-02 19:14:12 +00:00
Chris Lattner
2a36482e74
Further simplifications
...
llvm-svn: 8321
2003-09-02 16:46:41 +00:00
Chris Lattner
e0703ff161
Change the code to no longer compute the "type description" immediately when
...
the type is analyzed. Instead, only compute it when requested (with
getDescription), and cached for reuse later.
This dramatically speeds up LLVM in general because these descriptions almost
_never_ need to be constructed. The only time they are used is when a type is
<<'d. Printing of modules by themselves uses other code to print symbolic
types when possible, so these descriptions are really only used for debugging.
Also, this fixes the particularly bad case when lots of types get resolved to
each other, such as during linking of large programs. In these cases, the type
descriptions would be repeatedly recomputed and discarded even though: A. noone
reads the description before it gets resolved, and B. many many resolutions
happen at intermediate steps, causing a HUGE waste of time.
Overall, this makes the getTypeDesc function much more light-weight, and fixes
bug: Assembler/2002-07-08-HugePerformanceProblem.llx, which went from taking
1048.770u/19.150s (which is 17.5 MINUTES, on apoc), to taking 0.020u/0.000s,
which is a nice little speedup. :)
llvm-svn: 8320
2003-09-02 16:35:17 +00:00
Brian Gaeke
e248195b22
Remove assertion which is never reached.
...
llvm-svn: 8318
2003-09-02 06:45:34 +00:00
Chris Lattner
bd717d897f
Implement new method
...
llvm-svn: 8238
2003-08-31 00:19:28 +00:00
Chris Lattner
a38adaa88f
Fix bug: Linker/2003-08-28-TypeResolvesGlobal3.ll
...
Use new replaceAllUsesWith stuff in a way that works even though types have not yet been propagated
llvm-svn: 8210
2003-08-29 05:37:22 +00:00
Chris Lattner
c27038d7b5
Implement "unsafe" replaceAllUsesWWith stuff for use during type resolution.
...
llvm-svn: 8209
2003-08-29 05:36:46 +00:00
Chris Lattner
6097d94295
Fix bug: Linker/2003-08-28-TypeResolvesGlobal2.ll
...
llvm-svn: 8206
2003-08-29 05:11:34 +00:00
Chris Lattner
9f15812e88
Refactor code to make it useful outside of Constants.cpp
...
llvm-svn: 8205
2003-08-29 05:09:37 +00:00
Chris Lattner
ae77242011
Fix bug: Linker/2003-08-28-TypeResolvesGlobal.ll
...
llvm-svn: 8202
2003-08-29 04:49:54 +00:00
Chris Lattner
ea9891311a
As it turns out, things will be simpler than I first expected. We no longer
...
need any exception handling intrinsics beyond llvm.unwind. (yaay)
llvm-svn: 8145
2003-08-25 22:35:01 +00:00
Chris Lattner
8068e0cd17
Support new 'any' support for pointer size and endianness
...
llvm-svn: 8119
2003-08-24 13:48:48 +00:00
Chris Lattner
7da3571af9
rethrow is really the language independent primitive here. "throw" can be written
...
in terms of it and llvm.exc.setcurrent.
Rework the intrinsics.
llvm-svn: 8110
2003-08-24 12:24:08 +00:00
Chris Lattner
ca3e569269
Fix copy-and-paste-o
...
llvm-svn: 8104
2003-08-24 06:57:53 +00:00
Chris Lattner
ade9410c99
Initial support for recognizing LLVM exception handling intrinsics
...
llvm-svn: 8102
2003-08-24 05:30:29 +00:00
Chris Lattner
6d5693566f
Allow specifying the name for the newly split basic block
...
llvm-svn: 8097
2003-08-24 03:41:39 +00:00
Chris Lattner
180e14cb87
Rename SwitchInst::dest_push_back -> addCase
...
Add new removeCase method
llvm-svn: 8088
2003-08-23 23:14:37 +00:00
Chris Lattner
1c3430491e
If an "LLVM name" has wierd characters in it, print it out in double quotes instead of prefixing it with %
...
llvm-svn: 8049
2003-08-22 05:40:38 +00:00
Misha Brukman
be372b91e1
The word `dependent' has no `a'.
...
llvm-svn: 8030
2003-08-21 22:14:26 +00:00
Chris Lattner
941b06bf3c
Implement Assembler/2003-08-21-ConstantExprCast-Fold.llx
...
llvm-svn: 8015
2003-08-21 19:45:55 +00:00
Chris Lattner
ddab239262
Implement testcase: Assembler/2003-08-20-ConstantExprGEP-Fold.llx
...
llvm-svn: 7983
2003-08-20 16:11:27 +00:00
Chris Lattner
f8a77578a2
Do not even attempt to compute dominator information for unreachable blocks
...
llvm-svn: 7963
2003-08-18 22:11:16 +00:00
Chris Lattner
ab69ecc6d5
Fix linking bug in xboard
...
llvm-svn: 7952
2003-08-18 16:54:48 +00:00
Chris Lattner
748e9e143b
Add intrinsics for the llvm.sig(set|long)jmp functions
...
llvm-svn: 7949
2003-08-18 15:41:24 +00:00
Misha Brukman
7eb05a170a
Spell `necessary' correctly.
...
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Brian Gaeke
2cc4b9dd2c
Add new method to FunctionPassManager to add ImmutablePasses.
...
llvm-svn: 7838
2003-08-14 06:07:57 +00:00
Chris Lattner
e7e094467d
Dramatically simplify how -time-passes works.
...
This also enables -time-passes for FunctionPassManagers, which allows it to
be used for the JIT
llvm-svn: 7834
2003-08-14 05:20:28 +00:00
Chris Lattner
cea4d8c2f5
Implement constant folding of casts from boolean constants to other values
...
llvm-svn: 7812
2003-08-13 15:52:25 +00:00
Brian Gaeke
b7a8388b8c
Add FunctionPassManager - it's like a PassManager, but it only deals in
...
FunctionPasses.
llvm-svn: 7778
2003-08-12 17:22:39 +00:00
Chris Lattner
4159fdaef2
Add a bunch of new Alpha Intrinsics for Rahul Joshi
...
llvm-svn: 7646
2003-08-06 20:08:25 +00:00
Chris Lattner
463d6a5e7c
Implement TODO: print out short form of Invoke if possible
...
llvm-svn: 7595
2003-08-05 15:34:45 +00:00
Tanya Lattner
f8c563f76c
*** empty log message ***
...
llvm-svn: 7447
2003-07-31 05:06:09 +00:00
Tanya Lattner
a93c7aeb7e
Added function to determine if an Instruction may trap.
...
llvm-svn: 7442
2003-07-31 04:05:50 +00:00
Chris Lattner
3a5c2826d5
Fix a bug that brian reported
...
llvm-svn: 7428
2003-07-30 19:04:37 +00:00
Chris Lattner
60104f00c7
Add support for Alpha intrinsics, contributed by Rahul Joshi
...
llvm-svn: 7373
2003-07-28 21:20:57 +00:00
Chris Lattner
4b4dacd838
Make Module::getNamedFunction prefer non-external functions if there is more than
...
one function of the same name
llvm-svn: 7274
2003-07-23 20:21:30 +00:00
Chris Lattner
f26a8ee580
Remove redundant const qualifiers from cast<> expressions
...
llvm-svn: 7253
2003-07-23 15:30:06 +00:00
Chris Lattner
6077c3195f
Simplify code by using ConstantInt::getRawValue instead of checking to see
...
whether the constant is signed or unsigned, then casting
llvm-svn: 7252
2003-07-23 15:22:26 +00:00
Misha Brukman
7fdaab4f68
The word `separate' only has one `e'.
...
llvm-svn: 7173
2003-07-14 17:20:40 +00:00
John Criswell
3ef61afb76
Merged in autoconf branch. This provides configuration via the autoconf
...
system.
llvm-svn: 7014
2003-06-30 21:59:07 +00:00
Chris Lattner
d401f39872
Avoid printing out huge structures or arrays if they are just filled with zeros
...
llvm-svn: 6938
2003-06-28 20:08:24 +00:00
Chris Lattner
4ede64e304
Implement more aggressive folding of constant GEP instructions
...
llvm-svn: 6913
2003-06-26 05:22:45 +00:00
Chris Lattner
8bd8bc8399
Make assertion more descriptive
...
llvm-svn: 6889
2003-06-24 22:20:19 +00:00
Chris Lattner
4c9cd8262a
Add support for GCC 3.3
...
llvm-svn: 6865
2003-06-23 19:16:20 +00:00
Chris Lattner
22ced56476
Fix bug: InstCombine/2003-06-22-ConstantExprCrash.ll
...
llvm-svn: 6857
2003-06-22 20:48:30 +00:00
Chris Lattner
0cfcaf0cc3
Remove usage of sys/unistd.h
...
llvm-svn: 6788
2003-06-19 18:42:09 +00:00
Chris Lattner
8826647168
Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'.
...
llvm-svn: 6774
2003-06-18 19:22:36 +00:00
Brian Gaeke
87b4f0765c
lib/CWriter/Writer.cpp: Copy AsmWriter's ConstantFP checking code here
...
into a new function FPCSafeToPrint(), and use it in printConstant()
and printFunction() to decide whether we should output ConstantFPs as
floating-point constants or as references to stack-allocated variables.
lib/VMCore/AsmWriter.cpp: Fix an apparent typo in the code mentioned above.
llvm-svn: 6762
2003-06-17 23:55:35 +00:00
Chris Lattner
cc7d6ff656
Fix bug: Linker/2003-06-02-TypeResolveProblem2.ll
...
llvm-svn: 6699
2003-06-16 12:11:33 +00:00
Chris Lattner
d295d99664
Fix (bogus) possibly uninitialized warning
...
llvm-svn: 6634
2003-06-05 21:01:26 +00:00
Chris Lattner
93c8f14906
* Make assertion message useful
...
* Kill dead conditional
llvm-svn: 6544
2003-06-02 17:42:47 +00:00
Chris Lattner
7fa6783a01
Fix bug: Linker/2003-06-02-TypeResolveProblem.ll
...
llvm-svn: 6542
2003-06-02 17:25:46 +00:00
Chris Lattner
39adbfca5b
Don't print out unique identifier for opaque types
...
llvm-svn: 6511
2003-06-01 03:45:51 +00:00
Chris Lattner
8acf346e20
Fix constant folding to ALWAYS work.
...
llvm-svn: 6355
2003-05-27 19:16:07 +00:00
Chris Lattner
20ec7bc0db
Fix problem with last checkin.
...
llvm-svn: 6328
2003-05-25 16:15:32 +00:00
Chris Lattner
98fa07b1d5
Fix Bug: Linker/2003-04-26-NullPtrLinkProblem.ll
...
This was a problem with constants having their types resolved to some new type,
but there was already a constant of the new type created. Before, these types
were never merged together, now they are.
llvm-svn: 6314
2003-05-23 20:03:32 +00:00
Chris Lattner
f31a257bfb
Remove using declarations and extraneous #includes
...
llvm-svn: 6303
2003-05-22 21:47:17 +00:00
Chris Lattner
ef76b27a19
Fix static constructor ordering problem
...
llvm-svn: 6302
2003-05-22 21:31:52 +00:00
Chris Lattner
5eef9ffc27
Remove using declarations
...
llvm-svn: 6300
2003-05-22 21:21:43 +00:00
Chris Lattner
38a9bcde76
Add support for shift constant expressions
...
llvm-svn: 6260
2003-05-21 17:49:25 +00:00
Misha Brukman
e5838c4d72
s/convertable/convertible/g
...
llvm-svn: 6248
2003-05-20 18:45:36 +00:00
Chris Lattner
192623ec93
Add support for setjmp/longjmp primitives
...
Patch checked in for Bill Wendling :)
llvm-svn: 6241
2003-05-17 22:26:33 +00:00
Chris Lattner
cb4d26fb95
Fix bug: Assembler/2003-05-15-AssemblerProblem.llx
...
llvm-svn: 6234
2003-05-15 19:37:21 +00:00
Chris Lattner
55ed6561a1
Remove unnecessary casts
...
llvm-svn: 6201
2003-05-14 17:51:05 +00:00
Chris Lattner
15285abcbe
Print opaque types
...
llvm-svn: 6200
2003-05-14 17:50:47 +00:00
Chris Lattner
69f6af1604
Fix bug
...
llvm-svn: 6184
2003-05-14 02:47:13 +00:00
Chris Lattner
c2ceed1b38
Implement another getelementptr folding opportunity that arises when
...
linking stuff with appending linkage
llvm-svn: 6180
2003-05-13 21:50:52 +00:00
Chris Lattner
2b383d2ef2
Eliminate using declarations
...
llvm-svn: 6179
2003-05-13 21:37:02 +00:00
Chris Lattner
4dc3fcaff3
Fix bug: Dominators/2003-05-12-UnreachableCode.ll
...
llvm-svn: 6158
2003-05-12 22:35:13 +00:00
Chris Lattner
26891626fc
Fix Bug: ConstProp/2003-05-12-DivideError.ll
...
llvm-svn: 6125
2003-05-12 15:26:25 +00:00
Chris Lattner
bad4b4a52b
llvm.va_start only takes on argument now
...
Verify that va_start doesn't occur in functions with no varargs
llvm-svn: 6038
2003-05-08 15:55:31 +00:00
Chris Lattner
bb346d07b5
Add more support for intrinsic functions and for varargs stuff
...
llvm-svn: 6035
2003-05-08 03:47:33 +00:00
Chris Lattner
f70da10697
Add support for the new va_arg instruction
...
llvm-svn: 6029
2003-05-08 02:44:12 +00:00
Chris Lattner
ab7d1ab806
Remove using declarations
...
llvm-svn: 6022
2003-05-08 02:08:14 +00:00
Chris Lattner
ef8c8332b1
Fix a bug that occurred when removing the last predecessor INTO an
...
infinite loop
llvm-svn: 5953
2003-04-25 23:14:19 +00:00
Chris Lattner
e17c1c5ad8
** CORRECTLY, conservatively handle constant expressions
...
llvm-svn: 5924
2003-04-25 02:52:06 +00:00
Chris Lattner
60430423c9
Fix a nasty bug where the ConstantMerge pass was invalidating the TargetData pass
...
even though it was immutable. Immutable passes should never end up in CurrentAnalyses!
llvm-svn: 5906
2003-04-24 20:07:38 +00:00
Chris Lattner
889f620841
Remove unnecesary &*'s
...
llvm-svn: 5872
2003-04-23 16:37:45 +00:00
Chris Lattner
c840aa64e2
Emit information about target
...
llvm-svn: 5844
2003-04-22 19:07:19 +00:00
Chris Lattner
c3f6e00011
Add support for tracking whether a module is 64/32 bit and big/little endian
...
Also add a moduleID field which can be used for diagnostics
llvm-svn: 5834
2003-04-22 18:02:04 +00:00
Chris Lattner
534952b0d5
Remove arbitrary limitation
...
llvm-svn: 5818
2003-04-19 00:50:37 +00:00
Chris Lattner
acdbe7158d
Don't build constantexprs that could be folded
...
llvm-svn: 5801
2003-04-17 19:24:48 +00:00
Chris Lattner
1f0049c79c
Allow constant folding of GEP instructions, even if we don't do a whole lot yet.
...
Fold ConstExpr casts better
castToPointer shouldn't be forced to return a constantpointer
llvm-svn: 5800
2003-04-17 19:24:18 +00:00
Chris Lattner
46b3d30bf6
Change the interface to constant expressions to allow automatic folding
...
llvm-svn: 5793
2003-04-16 22:40:51 +00:00
Chris Lattner
3ac483bc89
Add code to verify correctly linkages
...
llvm-svn: 5788
2003-04-16 20:42:40 +00:00
Chris Lattner
379a8d2d1c
Add new linkage types to support a real frontend
...
llvm-svn: 5786
2003-04-16 20:28:45 +00:00
Chris Lattner
deccfafddb
Improve the efficiency and cleanup writing a bit
...
llvm-svn: 5782
2003-04-16 20:20:02 +00:00
Chris Lattner
9ad7757e7c
Add helper method
...
llvm-svn: 5753
2003-03-21 21:41:02 +00:00
Chris Lattner
faca62c74a
* Change the order that globals and constants are processed in
...
* Add support for implicit zero initializers
llvm-svn: 5750
2003-03-19 20:57:22 +00:00
Chris Lattner
83e5d39566
Fix ConstantUInt::isAllOnesValue
...
llvm-svn: 5734
2003-03-10 22:39:02 +00:00
Chris Lattner
b825722ac0
Clean up cruft
...
llvm-svn: 5720
2003-03-06 23:23:32 +00:00
Chris Lattner
c33ae67237
Remove #include
...
Extend getNullValue to work with struct and array types
llvm-svn: 5718
2003-03-06 21:02:18 +00:00
Chris Lattner
fbb7739b13
Simplify some of the PHI node interfaces
...
llvm-svn: 5700
2003-03-05 21:15:12 +00:00
Chris Lattner
d4ed5c67e9
Allow ImmutablePass's to require other immutable passes and to be initialized
...
llvm-svn: 5630
2003-02-26 19:10:57 +00:00
Chris Lattner
ade85ecf77
Fix a misunderstanding of the standard associative containers
...
llvm-svn: 5565
2003-02-14 05:34:36 +00:00
Chris Lattner
3789369330
This speeds up processing LLVM a _lot_, 17% in the case of loading and destroying "vortex"
...
llvm-svn: 5553
2003-02-13 19:46:22 +00:00
Chris Lattner
34a5bb762d
Simplify assertions
...
llvm-svn: 5455
2003-02-01 03:33:22 +00:00
Joel Stanley
4b27ed9759
Added implementation of alternate CallInst constructors (one ctor is
...
for no actual parameters, and one ctor is for one actual parameter).
llvm-svn: 5452
2003-02-01 00:39:58 +00:00
Chris Lattner
6a61d257d6
Fix bug Regression/Verifier/2002-11-05-GetelementptrPointers.ll
...
llvm-svn: 5273
2003-01-14 22:19:44 +00:00
Chris Lattner
edac414cac
Make type resolution a bit more efficient
...
llvm-svn: 5265
2003-01-14 19:42:39 +00:00
Chris Lattner
76bff3438b
Fix bug: Assembler/2002-12-15-GlobalResolve.ll
...
llvm-svn: 5039
2002-12-15 16:41:52 +00:00
Chris Lattner
d53daec3e1
planes is not spelled with an O
...
llvm-svn: 5037
2002-12-15 16:20:23 +00:00
Chris Lattner
903a25d225
User defined operators are not supposed to live beyond the lifetime of the
...
pass. Detect and flag them.
llvm-svn: 4801
2002-11-21 16:54:22 +00:00
Chris Lattner
98cf1f5d64
- Eliminated the deferred symbol table stuff in Module & Function, it really
...
wasn't an optimization and it was causing lots of bugs.
llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner
b251c3d727
Eliminate the concept of a deferred symbol table. The optimization really isn't,
...
and it causes obscure bugs to show up in passes.
llvm-svn: 4777
2002-11-20 18:07:48 +00:00
Chris Lattner
b2e46c0714
Add a new Module::getNamedFunction method
...
llvm-svn: 4758
2002-11-19 18:41:44 +00:00
Chris Lattner
1f985e0d3c
Add a method "getMainFunction()" that efficiently locates 'main' in a module
...
llvm-svn: 4629
2002-11-08 20:34:02 +00:00
Chris Lattner
4d2997f25d
Fix nasty bug in ::isNeg()
...
llvm-svn: 4470
2002-10-31 17:09:06 +00:00
Chris Lattner
f6cfaedcff
Can simplify code now with the isCommutative() method.
...
llvm-svn: 4461
2002-10-31 04:24:23 +00:00
Chris Lattner
cab6c33811
New isAssociative/isCommutative inspection methods, graciously contributed by
...
Casey Carter.
llvm-svn: 4459
2002-10-31 04:14:01 +00:00
Misha Brukman
632df28deb
Fix spelling of `propagate'.
...
llvm-svn: 4423
2002-10-29 23:06:16 +00:00
Chris Lattner
820d971233
- Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
...
setPreservesCFG to be less confusing.
llvm-svn: 4255
2002-10-21 20:00:28 +00:00
Chris Lattner
33100eddd2
- Eliminate SymbolTable::ParentSymTab, ST::localLookup, and
...
Function::ParentSymTab. These aren't needed at all.
llvm-svn: 4186
2002-10-15 21:26:29 +00:00
Chris Lattner
163b890dfb
- Dramatically simplify the Constant::mutateReferences implementation,
...
allowing it to be called on all constant types (structures/arrays)
llvm-svn: 4160
2002-10-14 03:30:23 +00:00
Chris Lattner
251a7e6231
Minor cleanups, no changes to functionality
...
llvm-svn: 4157
2002-10-14 00:48:57 +00:00
Chris Lattner
149376dee5
- Change Function's so that their argument list is populated when they are
...
constructed. Before, external functions would have an empty argument list,
now a Function ALWAYS has a populated argument list.
llvm-svn: 4149
2002-10-13 20:57:00 +00:00
Chris Lattner
69ce8674b5
- Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
...
reflect the fact that it's a range being defined.
llvm-svn: 4147
2002-10-13 19:39:16 +00:00
Chris Lattner
2c6abeac43
- Make Value::replaceAllUsesWith work with constants correctly. This fixes
...
bug FuncResolve/2002-08-19-ResolveGlobalVars.ll and gzip looks better.
llvm-svn: 4103
2002-10-09 23:12:59 +00:00
Chris Lattner
b1dd9bbc68
- Add new Constant::replaceUsesOfWithOnConstant which has an end result
...
similar to User::replaceUsesOfWith but actually does the right thing for
constants.
llvm-svn: 4102
2002-10-09 23:12:25 +00:00
Chris Lattner
6023f638a1
- Remove Value::use_remove
...
llvm-svn: 4090
2002-10-09 00:25:05 +00:00
Chris Lattner
3ea0c188b7
Fix NASTY N^2 behavior that was causing the gzip benchmark to take forever to
...
assemble. Now we scan the use-list from the back when removing users instead
of from the front.
llvm-svn: 4086
2002-10-08 23:46:55 +00:00
Chris Lattner
0d779712e7
Fix bug: Assembler/2002-10-08-LargeArrayPerformance.ll by using
...
std::vector::reserve when possible
llvm-svn: 4085
2002-10-08 23:33:52 +00:00
Chris Lattner
caf5b504a3
Changes to support PHINode::removeIncoming changes
...
llvm-svn: 4080
2002-10-08 21:36:34 +00:00
Chris Lattner
fae98a2d28
- Change PHINode::removeIncomingValue to delete the phi node if the last
...
incoming value is removed!
llvm-svn: 4078
2002-10-08 21:34:58 +00:00
Chris Lattner
acb038e5c7
Expose new "recalculate" method from dominatorset
...
llvm-svn: 4074
2002-10-08 19:12:08 +00:00
Chris Lattner
d131986b0f
Global variables are now external if they don't have initializers, not
...
"uninitialized"
llvm-svn: 4052
2002-10-06 22:48:09 +00:00
Chris Lattner
78bc0fa29f
Check that we don't have external varaibles with internal linkage
...
llvm-svn: 4051
2002-10-06 22:47:32 +00:00
Chris Lattner
4cd9df88a7
PHI nodes are not allowed to exist with zero incoming values, check that
...
there aren't any like this.
llvm-svn: 4044
2002-10-06 21:00:31 +00:00