Commit Graph

1233 Commits

Author SHA1 Message Date
Chris Lattner
80b97343ec 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10908 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-17 23:25:43 +00:00
Chris Lattner
d5c59d5c84 Cleanups & efficiency improvements
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10888 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 20:24:09 +00:00
Chris Lattner
8c202cdbda The bcwriter does not want ConstantPointerRef's to be indexed, and the asmwriter never did!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10885 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-15 18:47:15 +00:00
Chris Lattner
dcea63026f When emitting bytecode, handle strings specially. Do not add the characters
that make up the strings to the slotcalculator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10862 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 23:34:39 +00:00
Chris Lattner
f907bac068 Hrm, apparently I missed lowering this intrinsic. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10858 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 20:41:29 +00:00
Chris Lattner
7aa162b29b Fix bug in previous checkin: Demorgan would be ashamed of me, I need to
lay off the crack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10855 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 17:51:53 +00:00
Chris Lattner
13cfdea1ef Implement ConstantArray::isString
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10851 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 17:06:38 +00:00
Chris Lattner
c9b0702a89 Fix check. PHI nodes must be handled specially, of course.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10842 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 05:42:52 +00:00
Chris Lattner
30768ac3c2 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10841 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 04:25:59 +00:00
Chris Lattner
8ce750145d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10837 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 02:49:34 +00:00
Chris Lattner
504e8fb74e 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.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10812 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 05:51:55 +00:00
Chris Lattner
3a534f200a Implement new Instruction::isRelational method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10810 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 23:18:25 +00:00
Chris Lattner
eab20b58b1 Rearrange and comment code better. No functionality changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10808 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 22:07:24 +00:00
Chris Lattner
cbfd406541 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10807 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 21:13:12 +00:00
Chris Lattner
8b0f0cb908 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10806 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 21:02:29 +00:00
Chris Lattner
6b7b91ab03 Move ConstantHandling.h into lib/VMCore and out of include/llvm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10805 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:48:11 +00:00
Chris Lattner
731ba7f032 Eliminate a lot of out-of-date comments, and all of the wierd overloaded
operator constant folding stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10803 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:43:44 +00:00
Chris Lattner
4a0ecc8c0c Eliminate usage of the wierd overloaded operator constant folders
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10802 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:41:05 +00:00
Chris Lattner
d4403b4c3a Eliminate ConstantFoldShiftInstruction reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10801 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:40:42 +00:00
Chris Lattner
67bb7603ea Remove use of ConstantHandling itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10800 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 20:13:04 +00:00
Chris Lattner
69b9e892b6 Fix out of date comment, remove use of ConstantExpr::getShift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10794 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:12:58 +00:00
Chris Lattner
c6646ebdb9 Remove use of ConstantExpr::getShift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10792 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:10:58 +00:00
Chris Lattner
3edd3979e1 Make ConstantExpr::get work for shifts as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10790 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:04:55 +00:00
Chris Lattner
c4a1509829 Move prototype of llvm::ConstantFoldInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10786 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:25:44 +00:00
Chris Lattner
28aabc34f7 Move llvm::ConstantFoldInstruction from here to Transforms/Utils
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10784 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:25:03 +00:00
Chris Lattner
952454dbff Implement: Assembler/2004-01-11-getelementptrfolding.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10759 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-11 23:56:33 +00:00
Chris Lattner
92fa44c1cf Urg, remove testing code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10757 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-11 23:30:03 +00:00
Chris Lattner
9380297bc0 Fix a regression that I introduced yesterday. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10756 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-11 23:29:26 +00:00
Chris Lattner
a14b0d441d 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. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10754 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 23:46:13 +00:00
Chris Lattner
91d7efbf4b Hrm, another minor cleanup, which I missed before
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10753 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 21:42:24 +00:00
Chris Lattner
9a0817971a Minor cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10752 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 21:40:29 +00:00
Chris Lattner
f7703df496 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10727 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:12:26 +00:00
Chris Lattner
90ab32f9f0 Add support for new intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10701 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-06 05:33:02 +00:00
Chris Lattner
77b1330ece Add VMCore and code generator support for debugging intrinsics. By default
code generators completely ignore them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10691 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 05:36:30 +00:00
Chris Lattner
60837821e2 Add some comments, add new getGlobalVariable method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10671 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 08:43:01 +00:00
Chris Lattner
6d28a268c3 * Make Module::getTypeName const
* Add new Module::getTypeByName method
* Group methods in Module.cpp better


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10668 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 07:09:33 +00:00
Chris Lattner
69284b03d1 Make the lookup method const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10667 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 07:08:19 +00:00
Chris Lattner
3b41e0e6f4 Fix PR198
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10659 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 03:19:37 +00:00
Chris Lattner
4b1be101fb Add comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10658 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 02:50:02 +00:00
Chris Lattner
f70e0c216c Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10636 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 21:23:38 +00:00
Chris Lattner
42450d8a5f Move into the VMCore library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10623 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 08:30:20 +00:00
Chris Lattner
3b66ecb05f Implement the default implementation of the intrinsic lowering class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10621 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 08:19:41 +00:00
Chris Lattner
2cdd21c2e4 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10464 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 21:35:53 +00:00
Chris Lattner
eae45cf44b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10302 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-07 00:55:32 +00:00
Chris Lattner
16addf87bf 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10301 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-07 00:38:08 +00:00
Chris Lattner
d85cbe8f69 Fix const correctness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10229 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 21:28:00 +00:00
Chris Lattner
b9da9c137d Relax constrains on GEP type indexes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10228 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 21:21:46 +00:00
Chris Lattner
c282f5a380 Check return types of functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10146 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 22:32:23 +00:00
Chris Lattner
afd0b4b24a Fix problem Reid was having with external globals and nonexternal linkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10133 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 20:33:27 +00:00
Chris Lattner
31f8499e83 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10131 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 20:23:48 +00:00
Chris Lattner
15e8752e8f Fix some problems with assertions printing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10129 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 17:35:51 +00:00
Chris Lattner
7334f2e3da improve error message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10128 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 17:06:29 +00:00
Chris Lattner
108e4ab159 Minor cleanups and simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10127 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 16:52:05 +00:00
Chris Lattner
f8485c6434 Start using the nicer terminator auto-insertion API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10111 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:25:24 +00:00
Chris Lattner
adbc0b5287 Spew symbolic types!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10110 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:23:14 +00:00
Chris Lattner
593ba8f560 Somehow I forgot poor little UnwindInst
*sniff*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10108 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:11:56 +00:00
Chris Lattner
4b74c83334 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10107 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 17:45:12 +00:00
Chris Lattner
4e4d8624c5 Don't crash if we are printing an orphaned basic block!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10100 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 00:09:43 +00:00
Chris Lattner
bb4a15ca57 Really, there was a reason for me factoring that out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10089 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 19:20:20 +00:00
Chris Lattner
542d991451 *** 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10088 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 19:10:23 +00:00
Chris Lattner
f2586d13d5 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10080 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 06:14:38 +00:00
Chris Lattner
7dadaa2785 Fix PR130, and testcase test/Regression/Linker/2003-11-18-TypeResolution.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10075 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 01:02:52 +00:00
Chris Lattner
5d5a714b24 Implement == and != correctly. Before they would incorrectly return !=
for some constant exprs when they could really be the same value


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10058 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 20:19:35 +00:00
Chris Lattner
48babfa60d The ConstantPointer class is now gone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10057 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 19:47:21 +00:00
Chris Lattner
a83a6e4276 No REALLY, get rid of ConstantPointer references
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10054 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 19:21:04 +00:00
Chris Lattner
cf09f51bb9 Eliminate use of the ConstantPointer class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10053 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 19:19:32 +00:00
Chris Lattner
0dc396909e Constant folding shalt not be built on annotations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10052 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 19:05:17 +00:00
Chris Lattner
41495a21f9 Be a bit more tolerant of broken code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10050 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 01:17:04 +00:00
Brian Gaeke
cd4a398c25 When you hand WriteAsOperand a type, it now prints out its symbolic name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10042 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 23:08:27 +00:00
Brian Gaeke
9cebe2d83b When failing a Verifier assertion, use WriteAsOperand to print out the
offending types and/or values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10041 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 23:07:42 +00:00
Chris Lattner
40efcec8e8 Don't print 'No predecessors!' on the entry block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10038 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 22:59:57 +00:00
Chris Lattner
8b70b78ba4 Fixes for PR114: Thanks to Reid Spencer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 20:21:15 +00:00
Chris Lattner
5158aaf20e Expose the verifier to opt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9984 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-13 19:47:29 +00:00
Chris Lattner
579de71d08 Detect problems with PHI node operands!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9916 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-12 07:13:37 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Chris Lattner
d5b1245e8c Fix PR95. I'm checking this patch in for Reid Spencer, who figured it out
and wrote it up.  Thanks!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9832 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 19:39:48 +00:00
Chris Lattner
54baafd286 Add an assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9831 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 15:51:07 +00:00
Chris Lattner
d981f8af79 Further fixes for PR93
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9738 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 20:37:01 +00:00
Chris Lattner
29e3b2ba77 Add support for constant expr shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9735 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 19:53:03 +00:00
Chris Lattner
c4856f37f0 If we're not checking, don't check!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9732 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 19:09:40 +00:00
Chris Lattner
e860e0d69c Make code gcc 3.4 clean
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9719 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 05:15:42 +00:00
Chris Lattner
d5e4918fa7 Fix spello
Add negate overload


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9709 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 23:37:40 +00:00
John Criswell
700867bb69 Checking in Chris's suggestions:
Added assert() to ensure symbol table is well formed.
Added code to remember the value that was found; resolving types can change
the symbol table and invalidate the value of the iterator.
Added comments to the ResolveTypes() function (mainly for my own benefit).
Please feel free to correct the comments if they are not accurate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9693 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-04 15:22:26 +00:00
Chris Lattner
5bc3e31c54 Fix InstCombine/2003-11-03-VarargsCallBug.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9681 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-03 18:44:58 +00:00
Chris Lattner
bc539434c5 Did I mention that I _HATE_ CPRs?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9639 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-31 18:38:06 +00:00
Chris Lattner
b10bed8a63 Constant pointer refs are causing these to fail unnecessarily, which is causing
a lot of code to be pessimized.  I hate CPRs.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9635 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-31 17:51:16 +00:00
Alkis Evlogimenos
088eb45cf4 Use already existing classes for post order iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9629 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-31 03:02:34 +00:00
Chris Lattner
95e5a2cc3f Make use of the new AssemblyAnnotationWriter interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9619 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-30 23:41:03 +00:00
Alkis Evlogimenos
74fa84fcef 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9615 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-30 21:04:44 +00:00
Chris Lattner
88c1738064 Print the names of more opaque types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9598 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-30 00:22:33 +00:00
Chris Lattner
daf2a492a7 Make sure to print opaque types names if they are available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9597 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-30 00:12:51 +00:00
Alkis Evlogimenos
5d1bdcd6f6 Add more debugging info to help tracing the SlotCalculator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9575 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-29 03:12:12 +00:00
Chris Lattner
35956558e2 Fix test: Linker/2003-10-27-LinkOncePromote.ll
Fix PR58


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9530 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-27 16:39:39 +00:00
Chris Lattner
653de272c2 Fix bug: instcombine/2003-10-23-InstcombineNullFail.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9403 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-23 05:21:48 +00:00
Chris Lattner
aeb18ce9c0 Fix bug: Linker/2003-10-21-ConflictingTypesTolerance.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9357 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 22:46:38 +00:00
Chris Lattner
f85770c9a6 Fix message to make more sense and confuse Chris less
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9354 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 21:52:20 +00:00
Chris Lattner
2765c41c98 Make sure to add a type for va_next operands, which may not other wise
occur in the module


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9336 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 17:40:54 +00:00
Chris Lattner
389dbfbd8b Fix problem which effected linking apache
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9335 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 17:39:59 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +00:00
John Criswell
6fbcc26f14 Added LLVM copyright header (for lack of a better term).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9304 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 20:19:47 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
ce439b539f "Function"[0] == 'F', not 'M'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9297 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:10:06 +00:00
Chris Lattner
3b237fcd38 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-19 21:34:28 +00:00
Chris Lattner
4d45bd007d Add support for the new varargs intrinsics and instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9226 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-18 05:57:43 +00:00
Misha Brukman
c51aeaf059 Chris says it's better to assert that TheModule is valid than silently return 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9212 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 21:59:57 +00:00
Misha Brukman
7f3df4150c Return the Module that we just materialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9201 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 18:27:13 +00:00
Alkis Evlogimenos
60596382aa 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9190 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-17 02:02:40 +00:00
Chris Lattner
72ac148d49 Add support for 'weak' linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9171 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 18:29:00 +00:00
Chris Lattner
c3cc71abbc 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9160 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-16 16:53:07 +00:00
Misha Brukman
69c856aa6d Enabling incremental bytecode loading in the JIT:
* FunctionPassManager ctor now takes in a ModuleProvider
* run() materializes function before running passes on it


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9126 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-14 21:38:42 +00:00
Chris Lattner
cb18d181d1 Stop using "reverse depth first" order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9081 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 15:21:58 +00:00
Chris Lattner
5af41974c3 Speed up TypesEqual by specializing it for all of the derived types, avoiding
a lot of virtual method dispatch overhead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9078 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 14:55:56 +00:00
Chris Lattner
1825009ba8 Avoid creating lots of pointless opaque types, with short lifetimes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9076 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 14:03:36 +00:00
Chris Lattner
236f646371 This is a header file, hear me roar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9075 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 05:34:24 +00:00
Chris Lattner
3e58d9bb32 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9074 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 05:33:01 +00:00
Chris Lattner
cf3056db0f Regularize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-13 03:32:08 +00:00
Chris Lattner
5b62cdcf4a Rename method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9055 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-12 18:52:12 +00:00
Brian Gaeke
e24b616faa Don't include Config/stdio.h or <stdio.h>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9031 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 18:46:29 +00:00
Misha Brukman
cf00c4ab3b Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:57:28 +00:00
Misha Brukman
6b63452c3a Fix spelling/grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9023 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:54:14 +00:00
Chris Lattner
9eacf8aac8 Add a sanity check for constant expression casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8951 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-07 22:19:19 +00:00
Chris Lattner
4e84e7720c Users can never be null
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8895 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-06 17:33:39 +00:00
Chris Lattner
bede31ff3a 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8866 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-05 17:44:18 +00:00
Chris Lattner
ed468e37a1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8853 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-05 00:17:43 +00:00
Chris Lattner
00413e3d63 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8850 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-04 20:14:59 +00:00
Chris Lattner
70b06fc717 Minor random speedup: make Constant::getNullValue only call ConstantFOO::get
once!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8845 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 19:34:51 +00:00
Chris Lattner
23c3288ce9 Explicit copy ctors are no longer needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8844 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 19:02:41 +00:00
Chris Lattner
af6f93ce35 Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8843 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 18:57:54 +00:00
Chris Lattner
7685ac8d35 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 18:46:24 +00:00
Chris Lattner
9ad4dac582 These methods are dead, remove them. Because the bodies will soon be
ressurected, just ifdef them out for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8840 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 18:39:57 +00:00
Chris Lattner
8ef852f4ea 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8834 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-03 04:48:21 +00:00
Chris Lattner
1c5164e9cf 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8833 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 23:35:57 +00:00
Chris Lattner
3200219843 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-02 19:44:40 +00:00
Chris Lattner
48486893f4 Standardize header file comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8782 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-30 18:37:50 +00:00
Chris Lattner
1c9ab515de Do not use BasicBlock::succ_iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8700 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 22:03:22 +00:00
Misha Brukman
238fb25004 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8674 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-22 23:44:13 +00:00
Chris Lattner
02a3be020a Rename Function::getEntryNode -> getEntryBlock
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8625 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 14:39:18 +00:00
Chris Lattner
095e907125 Reject "llvm." as a function name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8608 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-19 19:31:41 +00:00
Misha Brukman
521f1feb11 Minimal implementation of the abstract ModuleProvider interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8594 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-18 16:17:06 +00:00
Chris Lattner
0981b62eec Change the semancics of the dropallrefs method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8572 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-17 04:58:59 +00:00
Chris Lattner
c444a4228f Renamed DominatorTree::Node::getNode() -> getBlock()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8469 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 16:26:13 +00:00
Chris Lattner
b884f597d6 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8461 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 20:37:51 +00:00
Brian Gaeke
053134a1ee Make createVerifierPass return a FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8449 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 19:37:04 +00:00
Chris Lattner
065a616ada Fix spell-o's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8431 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-10 05:29:43 +00:00
John Criswell
531922aaca 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8419 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 16:58:41 +00:00
John Criswell
21ca6ee7cd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8418 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-09 16:36:09 +00:00
Chris Lattner
ee5457cbe8 Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8411 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 19:44:26 +00:00
Chris Lattner
a6ce898dad Add support for unwind
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8407 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 18:54:36 +00:00
Chris Lattner
e5e475e09d Add support for volatile loads/stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8393 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 17:45:59 +00:00
Misha Brukman
c6315d9b27 Spell `occurrence' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8388 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-08 03:08:43 +00:00
Chris Lattner
c9b24a3bad Add asserts, move code around. This gets the dropAllTypeUses partially implemented
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8361 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 05:10:04 +00:00
Chris Lattner
8df956ccf2 Move functionality preserving changes.
Inline containsEquivalent
Remove some //'s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8358 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 02:39:52 +00:00
Chris Lattner
266caa2c3d Refactor what has effectively become copy-and-pasted code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8357 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 02:30:47 +00:00
Chris Lattner
169726b113 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8355 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-05 02:21:39 +00:00
Chris Lattner
663b479004 containsEquivalent never returns its argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8353 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:49:53 +00:00
Chris Lattner
a5112c768d Remove needless usage of getDescription()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8351 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:46:03 +00:00
Chris Lattner
e09a128df0 Inline method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8350 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:43:40 +00:00
Chris Lattner
a3057e8c89 Don't try to be sneaky, breaking recursive types in the process
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8348 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:41:03 +00:00
Chris Lattner
c34c13245a This is now unnecessary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8347 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-04 23:38:22 +00:00
Chris Lattner
b8565e3918 Fix bug where we couldn't print a function without a name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8341 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-03 17:56:43 +00:00
Chris Lattner
a3ad5b21e8 No need to rescan types when they are created.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8339 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-03 14:44:53 +00:00
Chris Lattner
a2f3e1d80b Another small speedup, this one to: 2.42s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8335 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 22:52:49 +00:00
Chris Lattner
d8d6c76a9a Don't return bogus references, and don't add an entry to the Concrete map
unless it's not empty!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8334 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 22:50:02 +00:00
Chris Lattner
1bb626387b Another optimization, speed up the testcase to 2.7s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8333 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 22:15:15 +00:00
Chris Lattner
bc4846d76c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8332 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 21:56:34 +00:00
Chris Lattner
87ca5faed7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8330 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 21:41:05 +00:00
Chris Lattner
de73193f3e 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8323 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 20:06:29 +00:00
Chris Lattner
11e405061b 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8322 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 19:14:12 +00:00
Chris Lattner
7ba77f2a63 Further simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 16:46:41 +00:00
Chris Lattner
dd4b421516 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.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 16:35:17 +00:00
Brian Gaeke
714a3a6cb5 Remove assertion which is never reached.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8318 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-02 06:45:34 +00:00
Chris Lattner
0ae8e87e53 Implement new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8238 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 00:19:28 +00:00
Chris Lattner
287d11191f 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8210 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 05:37:22 +00:00
Chris Lattner
23f3a49aec Implement "unsafe" replaceAllUsesWWith stuff for use during type resolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8209 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 05:36:46 +00:00
Chris Lattner
ad217a4ca2 Fix bug: Linker/2003-08-28-TypeResolvesGlobal2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8206 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 05:11:34 +00:00
Chris Lattner
2bc065b63a Refactor code to make it useful outside of Constants.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8205 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 05:09:37 +00:00
Chris Lattner
652f032ce9 Fix bug: Linker/2003-08-28-TypeResolvesGlobal.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8202 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-29 04:49:54 +00:00
Chris Lattner
841e00b962 Fix bug where we considered function types equivalent even if they had differing numbers of arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8178 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-28 16:42:50 +00:00
Chris Lattner
bfa964699f As it turns out, things will be simpler than I first expected. We no longer
need any exception handling intrinsics beyond llvm.unwind. (yaay)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8145 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-25 22:35:01 +00:00
Chris Lattner
aa8a847c62 Mangle ALL letters that we do not allow, not just a few.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8140 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 21:08:38 +00:00
Chris Lattner
77c5f733ac Fix bug: Linker/2003-08-23-GlobalVarLinking.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8130 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:30:20 +00:00
Chris Lattner
873c5e7859 Implement: Linker/2003-08-24-InheritPtrSize.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8129 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 19:26:42 +00:00
Chris Lattner
eb5d3a1526 Support new 'any' support for pointer size and endianness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8119 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 13:48:48 +00:00
Chris Lattner
101d40060c rethrow is really the language independent primitive here. "throw" can be written
in terms of it and llvm.exc.setcurrent.

Rework the intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8110 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 12:24:08 +00:00
Chris Lattner
7f736c9351 Fix copy-and-paste-o
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8104 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 06:57:53 +00:00
Chris Lattner
9dd7d1c8eb Initial support for recognizing LLVM exception handling intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8102 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 05:30:29 +00:00
Chris Lattner
4bd4aa5e3c Allow specifying the name for the newly split basic block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8097 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 03:41:39 +00:00
Chris Lattner
131d19f9c6 Rename SwitchInst::dest_push_back -> addCase
Add new removeCase method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8088 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 23:14:37 +00:00
Chris Lattner
f44c6051e0 Do not consider any types that exist in the global symbol table!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8084 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 21:32:24 +00:00
Chris Lattner
e3092c94ad Fix bug: Linker/2003-08-23-RecursiveOpaqueTypeResolve.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8083 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 21:25:54 +00:00
Chris Lattner
fcd0234de6 Implement Linker/2003-08-23-GlobalVarLinking.ll, which should fix 176.gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8080 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 20:31:10 +00:00
Chris Lattner
9732be769e Fix typeo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8059 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-22 20:16:48 +00:00
Chris Lattner
43f4ba8c7d The process of linking types can cause their addresses to become invalid. For this reason, we must use TypeHandles!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8057 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-22 19:12:55 +00:00
Chris Lattner
e76c57ad46 Implement Linker/2003-08-20-OpaqueTypeResolve.ll
Hopefully this will fix the 176.gcc spec test as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8051 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-22 06:07:12 +00:00
Chris Lattner
24b8a5d6e7 If an "LLVM name" has wierd characters in it, print it out in double quotes instead of prefixing it with %
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8049 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-22 05:40:38 +00:00
Misha Brukman
ef6a6a69ff The word dependent' has no a'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:14:26 +00:00
Chris Lattner
0425a87a62 Implement Assembler/2003-08-21-ConstantExprCast-Fold.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8015 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 19:45:55 +00:00
Chris Lattner
4b517a4654 Implement testcase: Assembler/2003-08-20-ConstantExprGEP-Fold.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7983 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-20 16:11:27 +00:00
Chris Lattner
24f83a15dd Do not even attempt to compute dominator information for unreachable blocks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7963 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 22:11:16 +00:00
Chris Lattner
8164d6535a Fix linking bug in xboard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7952 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 16:54:48 +00:00
Chris Lattner
8169cf810c Add intrinsics for the llvm.sig(set|long)jmp functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7949 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 15:41:24 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Brian Gaeke
1d3fa21cdd Add new method to FunctionPassManager to add ImmutablePasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7838 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:07:57 +00:00
Chris Lattner
01189952bb Dramatically simplify how -time-passes works.
This also enables -time-passes for FunctionPassManagers, which allows it to
be used for the JIT


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7834 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 05:20:28 +00:00
Chris Lattner
3ccd0fd756 Implement constant folding of casts from boolean constants to other values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7812 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 15:52:25 +00:00
Brian Gaeke
8ab1ef265a Add FunctionPassManager - it's like a PassManager, but it only deals in
FunctionPasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7778 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 17:22:39 +00:00
Chris Lattner
2b3860faeb Add support to the mangler for targets which require _'s on global symbols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7741 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 19:34:29 +00:00
Chris Lattner
c232818432 Add a bunch of new Alpha Intrinsics for Rahul Joshi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7646 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 20:08:25 +00:00
Chris Lattner
7a012299ce Implement TODO: print out short form of Invoke if possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7595 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 15:34:45 +00:00
Tanya Lattner
ec127bb352 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7447 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 05:06:09 +00:00
Tanya Lattner
741bb0019d Added function to determine if an Instruction may trap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7442 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-31 04:05:50 +00:00
Chris Lattner
61972242f3 Fix a bug that brian reported
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7428 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-30 19:04:37 +00:00
Chris Lattner
2418b117ba Add support for Alpha intrinsics, contributed by Rahul Joshi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7373 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-28 21:20:57 +00:00
Brian Gaeke
6b902dcd5d Include llvm/Support/Mangler.h first. Don't include <iostream>, <set>,
<string>, or llvm/Value.h.  Move up the inclusion of llvm/Support/Mangler.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:21:20 +00:00
Brian Gaeke
4166445b7c Cleanups:
Mangler.cpp: Constify parameter to makeNameProper, and use const_iterator.
 Make Count an unsigned int, and use utostr().
 Don't name parameters things that start with underscore.
Mangler.h: All of the above, and also: Add Emacs mode-line.  Include <set>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7301 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 21:37:57 +00:00
Brian Gaeke
b198ca304b Factor out name-mangling from X86/Printer, which is derived from CWriter,
into this new support class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7300 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 20:20:58 +00:00
Chris Lattner
b6ede8aaa0 Make Module::getNamedFunction prefer non-external functions if there is more than
one function of the same name


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7274 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 20:21:30 +00:00
Chris Lattner
30780ccf15 Add support for ~ operator on constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7258 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 17:21:17 +00:00
Chris Lattner
949a362802 Remove redundant const qualifiers from cast<> expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7253 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:30:06 +00:00
Chris Lattner
c07736a397 Simplify code by using ConstantInt::getRawValue instead of checking to see
whether the constant is signed or unsigned, then casting


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 15:22:26 +00:00
Misha Brukman
bc0e998c49 The word separate' only has one e'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7173 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-14 17:20:40 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Chris Lattner
e9a64ea38e Avoid printing out huge structures or arrays if they are just filled with zeros
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6938 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 20:08:24 +00:00
Chris Lattner
6a2a60aaf3 Implement more aggressive folding of constant GEP instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6913 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 05:22:45 +00:00
Chris Lattner
a89ab2c355 Make assertion more descriptive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6889 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-24 22:20:19 +00:00
Chris Lattner
1d5fc3f416 Add support for GCC 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6865 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 19:16:20 +00:00
Chris Lattner
037d258319 Fix bug: InstCombine/2003-06-22-ConstantExprCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6857 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 20:48:30 +00:00
Chris Lattner
3889a2cb05 Remove a ton of extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:08:05 +00:00
Chris Lattner
ed4775a3c1 Remove usage of sys/unistd.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6788 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 18:42:09 +00:00
Chris Lattner
893f025262 Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6774 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 19:22:36 +00:00
Brian Gaeke
b471a23a85 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6762 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 23:55:35 +00:00
Chris Lattner
6b0b2db326 Fix bug: Linker/2003-06-02-TypeResolveProblem2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6699 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 12:11:33 +00:00
John Criswell
be583b914d Included assert.h so that the code compiles under newer versions of GCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6682 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-11 14:01:36 +00:00
Chris Lattner
9783301b9d Fix (bogus) possibly uninitialized warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6634 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-05 21:01:26 +00:00
Chris Lattner
b84388937c * Make assertion message useful
* Kill dead conditional


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6544 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 17:42:47 +00:00
Chris Lattner
bf44ecccdb Fix bug: Linker/2003-06-02-TypeResolveProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6542 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-02 17:25:46 +00:00
Chris Lattner
26c6915539 Don't print out unique identifier for opaque types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6511 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-01 03:45:51 +00:00
Chris Lattner
5c38e99c59 Fix constant folding to ALWAYS work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6355 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-27 19:16:07 +00:00
Chris Lattner
9608c81d01 Fix problem with last checkin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6328 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-25 16:15:32 +00:00
Chris Lattner
02ec5ede6c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6314 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-23 20:03:32 +00:00
Chris Lattner
e3d3219f76 Remove using declarations and extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6303 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:47:17 +00:00
Chris Lattner
950273b3e7 Fix static constructor ordering problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6302 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:31:52 +00:00
Chris Lattner
47697a18d2 Remove using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6300 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-22 21:21:43 +00:00
Chris Lattner
f31f583b15 Add support for shift constant expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6260 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-21 17:49:25 +00:00
Misha Brukman
f117cc9ee6 s/convertable/convertible/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6248 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 18:45:36 +00:00
Chris Lattner
c436b37262 Add support for setjmp/longjmp primitives
Patch checked in for Bill Wendling :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6241 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-17 22:26:33 +00:00
Chris Lattner
608f4b0287 Fix bug: Assembler/2003-05-15-AssemblerProblem.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6234 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-15 19:37:21 +00:00
Chris Lattner
4c00e53b81 Fix Bug: Linker/2003-05-15-TypeProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6225 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-15 16:30:55 +00:00
Chris Lattner
3b9922f99c Remove unnecessary casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6201 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-14 17:51:05 +00:00
Chris Lattner
9e094c40df Print opaque types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6200 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-14 17:50:47 +00:00
Chris Lattner
f41464618f Fix major problem with appending linkage changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6185 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-14 12:11:51 +00:00
Chris Lattner
e0c60038eb Fix bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6184 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-14 02:47:13 +00:00
Chris Lattner
0ec3590664 Implement another getelementptr folding opportunity that arises when
linking stuff with appending linkage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6180 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-13 21:50:52 +00:00
Chris Lattner
9bc02a4deb Eliminate using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6179 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-13 21:37:02 +00:00
Chris Lattner
8166e6eef6 Implement linkage of appending global variables!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6178 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-13 21:33:43 +00:00
Chris Lattner
a3c58f1c06 Fix bug: Dominators/2003-05-12-UnreachableCode.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6158 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 22:35:13 +00:00
Chris Lattner
893af8c058 Fix Bug: ConstProp/2003-05-12-DivideError.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6125 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-12 15:26:25 +00:00
Chris Lattner
27aa094f57 llvm.va_start only takes on argument now
Verify that va_start doesn't occur in functions with no varargs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6038 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 15:55:31 +00:00
Chris Lattner
dd035d188a Add more support for intrinsic functions and for varargs stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6035 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 03:47:33 +00:00
Chris Lattner
8f77daef04 Add support for the new va_arg instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 02:44:12 +00:00
Chris Lattner
7b13f56c36 Remove using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6022 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-08 02:08:14 +00:00
Chris Lattner
02a78cf7ea Fix a bug that occurred when removing the last predecessor INTO an
infinite loop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5953 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-25 23:14:19 +00:00
Chris Lattner
6cf4cb90a0 ** CORRECTLY, conservatively handle constant expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5924 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-25 02:52:06 +00:00
Chris Lattner
eca8e8f111 *** Huge: Make constantexprs be handled correctly, conservatively
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5923 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-25 02:51:46 +00:00
Chris Lattner
a172846d3a 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5906 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-24 20:07:38 +00:00
Chris Lattner
c2b97d43a0 Fix Bug: Linker/2003-04-23-LinkOnceLost.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5879 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 18:38:39 +00:00
Chris Lattner
e408e25132 Remove unnecesary &*'s
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5872 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-23 16:37:45 +00:00
Chris Lattner
43a9994c01 Add warning when linking modules with disagreeing target properties
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5845 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 19:13:20 +00:00
Chris Lattner
61a909a6fd Emit information about target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5844 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 19:07:19 +00:00
Chris Lattner
678c6a089d 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5834 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-22 18:02:04 +00:00
Chris Lattner
2719bac905 Fix bug: 2003-01-30-LinkerRename.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-21 21:15:04 +00:00
Chris Lattner
0fec08eb58 Fix linking a function with qualifiers to a external function declaration:
Fixed bug: Linker/2003-04-21-Linkage.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5827 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-21 21:07:05 +00:00
Chris Lattner
14e8e29105 Remove arbitrary limitation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5818 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-19 00:50:37 +00:00
Chris Lattner
d628f6a9a4 Don't build constantexprs that could be folded
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5801 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-17 19:24:48 +00:00
Chris Lattner
27287de06b 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5800 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-17 19:24:18 +00:00
Chris Lattner
fd73cf895c Don't force a ConstantPointer to be returned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5799 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-17 19:22:47 +00:00
Chris Lattner
fb242b6edc Change the interface to constant expressions to allow automatic folding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5793 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 22:40:51 +00:00
Chris Lattner
5399741622 Add code to verify correctly linkages
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5788 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:42:40 +00:00
Chris Lattner
4ad02e726d Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:28:45 +00:00
Chris Lattner
ffd9bf404c Improve the efficiency and cleanup writing a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5782 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:20:02 +00:00
Chris Lattner
f1ab454b71 Add helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5753 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-21 21:41:02 +00:00
Chris Lattner
3413d150dc * Change the order that globals and constants are processed in
* Add support for implicit zero initializers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5750 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-19 20:57:22 +00:00
Chris Lattner
1680312867 Fix ConstantUInt::isAllOnesValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5734 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-10 22:39:02 +00:00
Chris Lattner
38d8773650 Clean up cruft
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5720 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-06 23:23:32 +00:00
Chris Lattner
27accf7692 Remove #include
Extend getNullValue to work with struct and array types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5718 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-06 21:02:18 +00:00
Chris Lattner
05ddff9b98 Simplify some of the PHI node interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5700 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-05 21:15:12 +00:00
Chris Lattner
bf22c73c9c Allow ImmutablePass's to require other immutable passes and to be initialized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5630 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-26 19:10:57 +00:00
Chris Lattner
a3183be835 Fix a misunderstanding of the standard associative containers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5565 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 05:34:36 +00:00
Chris Lattner
0779388ff8 This speeds up processing LLVM a _lot_, 17% in the case of loading and destroying "vortex"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5553 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-13 19:46:22 +00:00
Chris Lattner
36e50ff3e4 Simplify assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5455 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-01 03:33:22 +00:00
Joel Stanley
95e8b1c976 Added implementation of alternate CallInst constructors (one ctor is
for no actual parameters, and one ctor is for one actual parameter).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5452 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-01 00:39:58 +00:00
Chris Lattner
2f6bb2bce1 * Fix linking of opaque types and their non-opaque versions
* Fix bug: Linker/2003-01-30-LinkerTypeRename.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5441 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 20:53:43 +00:00
Chris Lattner
5c2d335d86 Eliminate using decls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5439 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-30 19:53:34 +00:00
Chris Lattner
6d57086129 Fix bug Regression/Verifier/2002-11-05-GetelementptrPointers.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5273 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-14 22:19:44 +00:00
Chris Lattner
6a490cedb5 Make type resolution a bit more efficient
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5265 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-14 19:42:39 +00:00
Chris Lattner
197ff79a8c Fix bug: Assembler/2002-12-15-GlobalResolve.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5039 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 16:41:52 +00:00
Chris Lattner
8e637a9383 planes is not spelled with an O
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5037 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-15 16:20:23 +00:00
Chris Lattner
b91b657e02 Fix big bug introduced with symbol table changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4885 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 18:32:30 +00:00
Chris Lattner
627079d42a User defined operators are not supposed to live beyond the lifetime of the
pass.  Detect and flag them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4801 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-21 16:54:22 +00:00
Chris Lattner
6e6026b465 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 18:36:02 +00:00
Chris Lattner
2c08dcc276 Eliminate the concept of a deferred symbol table. The optimization really isn't,
and it causes obscure bugs to show up in passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 18:07:48 +00:00
Chris Lattner
9a641b4bce Add a new Module::getNamedFunction method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4758 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 18:41:44 +00:00
Chris Lattner
a9a93f3777 Add a method "getMainFunction()" that efficiently locates 'main' in a module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4629 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 20:34:02 +00:00
Chris Lattner
2fe6626ead Fix nasty bug in ::isNeg()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4470 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 17:09:06 +00:00
Chris Lattner
6b1c4fcfb5 Can simplify code now with the isCommutative() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4461 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 04:24:23 +00:00
Chris Lattner
f2da7241f5 New isAssociative/isCommutative inspection methods, graciously contributed by
Casey Carter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4459 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-31 04:14:01 +00:00
Misha Brukman
a3bbcb5b66 Fix spelling of `propagate'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4423 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-29 23:06:16 +00:00
Chris Lattner
cb2610ea03 - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4255 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-21 20:00:28 +00:00
Chris Lattner
0dad6e9c95 - Eliminate SymbolTable::ParentSymTab, ST::localLookup, and
Function::ParentSymTab.  These aren't needed at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4186 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-15 21:26:29 +00:00
Chris Lattner
34048e2ace - Dramatically simplify the Constant::mutateReferences implementation,
allowing it to be called on all constant types (structures/arrays)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4160 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 03:30:23 +00:00
Chris Lattner
479b54b6bb Minor cleanups, no changes to functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4157 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-14 00:48:57 +00:00
Chris Lattner
69da5cf261 - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 20:57:00 +00:00
Chris Lattner
0b16ae209a - Rename Instruction::First*Op to *OpsBegin, and Num*Ops to *OpsEnd to
reflect the fact that it's a range being defined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 19:39:16 +00:00
Chris Lattner
28eca8bb56 - Make Value::replaceAllUsesWith work with constants correctly. This fixes
bug FuncResolve/2002-08-19-ResolveGlobalVars.ll and gzip looks better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4103 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 23:12:59 +00:00
Chris Lattner
c251f9e0ae - Add new Constant::replaceUsesOfWithOnConstant which has an end result
similar to User::replaceUsesOfWith but actually does the right thing for
    constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4102 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 23:12:25 +00:00
Chris Lattner
61d295aa29 - Remove Value::use_remove
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4090 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 00:25:05 +00:00
Chris Lattner
d1c657e2c7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4086 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 23:46:55 +00:00
Chris Lattner
d43c7d2077 Fix bug: Assembler/2002-10-08-LargeArrayPerformance.ll by using
std::vector::reserve when possible


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4085 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 23:33:52 +00:00
Chris Lattner
dee430d26e Changes to support PHINode::removeIncoming changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4080 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:36:34 +00:00
Chris Lattner
8bcb768a9c - Change PHINode::removeIncomingValue to delete the phi node if the last
incoming value is removed!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4078 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 21:34:58 +00:00
Chris Lattner
7ca266fe1f Expose new "recalculate" method from dominatorset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4074 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-08 19:12:08 +00:00
Chris Lattner
0c5e362118 Global variables are now external if they don't have initializers, not
"uninitialized"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4052 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-06 22:48:09 +00:00
Chris Lattner
61b91bc156 Check that we don't have external varaibles with internal linkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4051 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-06 22:47:32 +00:00
Chris Lattner
f6ffcb6b71 PHI nodes are not allowed to exist with zero incoming values, check that
there aren't any like this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4044 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-06 21:00:31 +00:00
Chris Lattner
4e4caeffbd Fix a nasty problem with dominance calculation for unreachable blocks.
If we had a CFG that look like Entry -> B, Unreachable -> B, then we would
not correctly determine that Entry dominated B, because Entry did not
apparently dominate "unreachable".  This patch fixes this by making the entry
node dominate all blocks, including unreachable ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4037 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-04 14:45:48 +00:00
Chris Lattner
061269be97 - Print the predecessors of a basic block instead of the number of uses of
the block in the AsmWriter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4019 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-02 19:38:55 +00:00
Chris Lattner
57b062a8cc Make sure to use the TimerGroup that we created!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3995 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 20:12:06 +00:00
Chris Lattner
ccc7bef873 Make sure not to count the PassManager wrapers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3994 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 20:08:11 +00:00
Chris Lattner
f1da555028 Factor timer code out of PassManager implementation, into a generic interface
exposed by Support/Timer.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3993 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 19:54:07 +00:00
Chris Lattner
3f00ef9660 Fix a problem that was caused by stale analyses being in CurrentAnalyses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3981 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 22:50:22 +00:00
Chris Lattner
4d7a75a9e3 Improve printing of dominator sets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3976 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-29 21:42:42 +00:00
Chris Lattner
d74472ed21 - Add methods to ImmediateDominators & DominatorTree to allow updates
- Make DominatorTree::Node not inherit from std::vector


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3939 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 16:14:41 +00:00
Chris Lattner
0a1a874d1f - Add new ctor to BasicBlock to allow insertion before any BB, not just at
the end of the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3934 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 05:03:22 +00:00
Chris Lattner
6ffa0a7f7c * Fix ugly bug in previous checkin where I reused the name 'i' one too many times
* Print out immutable passes in the -debug-pass=Structure report.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3923 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 22:26:52 +00:00
Chris Lattner
70b4f3e051 Add support for ImmutablePasses, which are not run, and cannot be
invalidated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3921 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-25 21:59:11 +00:00
Chris Lattner
d149c053cd Insert resolved constants into the global map so they are reused correctly.
This bug was exposed linking the SPEC benchmark suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3888 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 18:14:15 +00:00
Chris Lattner
3f6962e088 Add an optimization to support the most common access pattern for the
library.  This speeds debug builds up significantly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3826 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-19 19:22:11 +00:00
Chris Lattner
3e1f144a1d Make sure that we abort if an error happens as early as neccesary. Before
it was possible for the passmanager to continue running passes after the
verifier even if the module was not well formed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3820 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-19 16:12:19 +00:00
Vikram S. Adve
d9bacc5a84 Remove specification of argument default from cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3772 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-17 01:17:57 +00:00
Chris Lattner
e87e1c9aa9 Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-13 22:28:50 +00:00
Chris Lattner
fa3068813b include/llvm/DataTypes.h includes this #define so we don't need it anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3708 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-13 22:24:57 +00:00
Chris Lattner
f90a0e4bd7 Another portability fix provided via Casey Carter:
ISSUE: getTimeRecord in lib/VMCore/Pass.cpp uses timeval and
gettimeofday() without including sys/time.h.

ACTION: Include sys/time.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3699 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-13 14:47:12 +00:00
Chris Lattner
e0a54f88a0 Add a new BasicBlockPass::doInitialization/Finalization(Function &) pair of
methods that may be useful for BasicBlockPasses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3688 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-12 17:06:40 +00:00
Chris Lattner
562219de55 Give better assertion message for error conditions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3680 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 01:21:04 +00:00
Chris Lattner
a98bde53a7 Allocation insts always have one operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3677 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-11 00:22:39 +00:00
Chris Lattner
62815d9672 Add convenience ctor to BranchInst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3676 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 23:54:58 +00:00
Chris Lattner
9a66d5109e Tighten up assertion checking for binary operators, not allowing invalid
instructions to _even be created_.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3661 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 19:57:53 +00:00
Chris Lattner
3bc06b33da Add support for printing constpointerrefs more nicely
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3654 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 15:53:49 +00:00
Chris Lattner
2aa831120c Add capability to insert an instruction into a basic block immediately after
it is created, as part of the ctor call.

Eliminate the GenericBinaryInst class


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3653 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 15:45:53 +00:00
Chris Lattner
6e65cda0ec Remove extra #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3652 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 15:43:30 +00:00
Chris Lattner
712653908e Fix typeo in assertion message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3641 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 04:52:59 +00:00
Chris Lattner
1a143aef99 Do not allow adds of pointer types, or many other operations on pointer types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3638 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-09 20:26:04 +00:00
Chris Lattner
c4e4a99677 Enable "garbage detection" of LLVM objects. Check for leaks after running
every pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3621 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 19:00:07 +00:00
Chris Lattner
d1e693f2a3 Enable "garbage detection" of LLVM objects. Now users should be obnoxious
warnings.  If they accidentally leak LLVM Value's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3620 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 18:59:35 +00:00
Chris Lattner
de69a4ca2f Checkin initial support for automatic memory leak detection routines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3618 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 18:51:16 +00:00
Chris Lattner
bded132d00 Move code out of header files into .cpp files to make future changes easier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3605 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-06 21:33:15 +00:00
Chris Lattner
482701563a * Remove extraneous #includes
* Add extra argument to Function ctor to allow automatic insertion into module


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3600 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-06 20:46:32 +00:00
Chris Lattner
20d4129fef Minor bug fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3577 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 23:12:40 +00:00
Chris Lattner
252030e86b Implement setcc for booleans. Fixes bug:
test/Regression/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3576 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 20:09:49 +00:00
Chris Lattner
0c4e886dbf - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3574 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 01:08:28 +00:00
Chris Lattner
ce8a14915d - Renamed Type::isIntegral() to Type::isInteger()
- Added new method Type::isIntegral() that is the same as isInteger, but
    also accepts bool.
SCVS: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3572 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-03 01:05:48 +00:00
Chris Lattner
d122f4b648 Fix bugs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3569 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-02 20:49:27 +00:00
Chris Lattner
96f9d7232c Add printing support to ConstantRange class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3565 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-02 00:18:22 +00:00
Chris Lattner
645e00d149 Initial implementation of ConstantRange support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3563 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-01 23:53:36 +00:00
Chris Lattner
ea8b7b8bb5 - Exposed SetCondInst::getInverseCondition & ::getSwappedCondition better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3562 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-01 19:46:40 +00:00
Chris Lattner
a3cd9de40e - Use Pass::AnalysisImpls instead of findAnalysisGroupMemeber
- -debug-pass=Details now prints implementation class names for analysis
    groups
  - Rework how AnalysisGroups are resolved to be simpler and better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3535 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-30 20:25:01 +00:00
Chris Lattner
1c28b42310 - PassManager prints analysis sets nicer
- Use Pass::AnalysisImpls instead of findAnalysisGroupMemeber


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3534 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-30 20:23:45 +00:00
Chris Lattner
93aeea3748 Add support for turning an array of characters into a string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3509 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-26 17:53:56 +00:00
Chris Lattner
cc63f1c674 Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3487 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 23:37:20 +00:00
Chris Lattner
24ea74eb9a Load & StoreInst no longer derive from MemAccessInst, so we don't have
to handle indexing anymore


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3485 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 22:49:05 +00:00
Chris Lattner
f150b9d984 Load and Store now no longer derive from MemAccessInst. Indexing a load or
store is not possible anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3482 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 22:47:47 +00:00
Chris Lattner
80b7f8ceb4 Fix bug: test/Regression/Assembler/2002-08-22-DominanceProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3474 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 20:39:29 +00:00
Chris Lattner
f20816bc78 - Fighting with linking problem due to removing the ::ID elements. Now the
implementation .cpp files for analyses are not being included into gccas
    and friends because it is linking to the .a file and there is no explicit
    symbol reference to bring in the .o file.  The new IncludeFile hack is the
    result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3436 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 23:51:51 +00:00
Chris Lattner
64339f681a Remove debugging code accidentally checked in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3430 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 22:49:31 +00:00
Chris Lattner
789bc84262 - Implement the new AnalysisGroup feature, neccesary for Value#ing and pointer analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3426 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 22:17:09 +00:00
Chris Lattner
607ace696b - Do not expose ::ID from any of the analyses anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3415 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 17:09:15 +00:00
Chris Lattner
fb30fda1de - Eliminate the need for analyses to expose an ::ID member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3414 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 17:08:37 +00:00
Chris Lattner
b319faff77 fixed bug: test/Regression/Linker/2002-08-20-ConstantExpr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3412 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-20 19:35:11 +00:00
Chris Lattner
b8fa514b1d Sort -time-passes report first by user+system, then by Wall clock time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3407 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-20 18:47:53 +00:00
Chris Lattner
e825bde125 Add new SetCondInst::getInverseCondition() method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3405 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-20 18:17:12 +00:00
Chris Lattner
db8d8eff2f Add missing space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3387 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19 20:42:12 +00:00
Chris Lattner
f5526b6edb Fix the -time-passes option to not print NaN when there is zero execution time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3382 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-19 15:43:33 +00:00
Chris Lattner
41661fdb2e - ConstantPointerRefs are now automatically removed from the module table
when they are destroyed, which makes Constant::destroyConstant an actually
    useful external interface.  Expose these methods publicly.
  - Implement destroyConstant on ConstPointerNull so that destroyConstant can
    be used on any derived type constant safely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3379 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-18 00:40:04 +00:00
Chris Lattner
9da0715aa4 Add Module::dump() method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3375 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-17 23:32:47 +00:00
Chris Lattner
1c93e5bd26 Changed parser to always use parenthesis on ConstExprs to be consistent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3363 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-16 21:17:11 +00:00
Chris Lattner
95586b8c83 Write constexpr casts using the cast X to Y notation, not using the implicit
type result


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3354 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 19:37:43 +00:00
Chris Lattner
96ad1ec876 Simplify the code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3348 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 16:15:36 +00:00
Vikram S. Adve
1718337cf7 Added more helper functions for binary instructions emulating
unary Neg and Not: isNeg, isNot, getNegArgument, and getNotArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3341 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-15 14:15:48 +00:00
Chris Lattner
ad333484ea Remove support for Not ConstantExpr. This simplifies the unary case to only
have to support the cast instruction, so the function is renamed to getCast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3328 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:24:09 +00:00
Chris Lattner
9c16dba29f Remove support for unary operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3326 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:19:46 +00:00
Chris Lattner
0513e9fe03 Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3323 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:18:02 +00:00
Chris Lattner
f4e3c006ac Remove constant propogation support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3321 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 18:17:07 +00:00
Chris Lattner
a9261ff5b7 Implement two constructor functions for "unary" instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3317 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:52:27 +00:00
Chris Lattner
589fda514c Remove support forNOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3316 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:52:06 +00:00
Chris Lattner
227b86c5fb Return null on failure, instead of aborting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3308 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:12:13 +00:00
Chris Lattner
9fb96412ae - Rename ConstantGenericIntegral -> ConstantIntegral
- Add new methods to ConstantIntegral: getMaxValue, getMinValue,
   getAllOnesValue


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3299 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-13 17:50:20 +00:00
Chris Lattner
994b9f337b - Added a new superclass of ConstantBool/ConstantInt: ConstantGenericIntegral
- Moved InstCombine: isMaxValue, isMinValue, isAllOnesValue to Constants.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3293 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-12 21:21:21 +00:00
Chris Lattner
bb6342b052 Remove some extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3289 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-12 20:24:46 +00:00
Chris Lattner
4228b5aac4 Changes to make GlobalValueRefMap not derive from std::map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3288 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-12 20:23:29 +00:00
Chris Lattner
dc1e020444 UnaryOperator::create should take a name just like BinaryOperator::create
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3279 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-09 21:39:38 +00:00
Chris Lattner
dd5b495129 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3264 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-08 19:01:28 +00:00
Chris Lattner
9ce231f3ae Implement dominator checking in the verifier, so that we check that all
defintiions dominate their uses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3214 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 17:37:08 +00:00
Chris Lattner
a915ef0fc0 Fix bug: test/Regression/Other/2002-08-02-DomSetProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3213 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 16:51:27 +00:00
Chris Lattner
4c9df7c619 Split dominance calculation and post dominance calculation stuff
Dominance calculation goes to VMCore library to be used by Verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3210 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 16:43:03 +00:00
Chris Lattner
ca0a1f7d49 Enhance -time-passes to be more detailed and useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3199 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-01 19:33:09 +00:00
Chris Lattner
fc94446777 Fix bug: test/Regression/Assembler/2002-07-31-SlashInString.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3195 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 23:56:44 +00:00
Chris Lattner
1b0a63fa64 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3185 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 19:32:01 +00:00
Chris Lattner
7a40d6db08 We need iostream in PassManagerT.h to use cerr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3183 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 18:04:17 +00:00
Chris Lattner
48c1bc7b3a Implement new -debug-pass=Arguments option that causes PassManager to
print out the command line options for the optimizations it is running.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3165 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 19:51:02 +00:00
Chris Lattner
c188eeb08c Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3161 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:25 +00:00
Chris Lattner
e8e4605021 Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3160 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:22 +00:00
Chris Lattner
ad772a7188 Remove FIXME's that aren't really needed after all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3158 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:38:54 +00:00
Chris Lattner
17689dfe24 Declare that these passes only depend on the CFG of the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3157 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:27:52 +00:00
Chris Lattner
37d66c4dea * Move some code from Pass.cpp to PassManagerT.h
* Implement stuff so that code can declare that they only depend on the CFG of
  a function, not on anything else.  This speeds up GCCAS a lot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3155 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:27:02 +00:00
Chris Lattner
5fa829c54a Implement constant propogation of logical (and, or, xor) expressions.
Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3154 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:24:28 +00:00
Chris Lattner
e56096aa41 Implement constant propogation of logical (and, or, xor) expressions.
Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3153 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:24:25 +00:00
Chris Lattner
d472e47b6c * Eliminate the Provided set. All Passes now finally just automatically
provide themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3125 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 21:03:38 +00:00
Chris Lattner
eb702350f7 * Eliminate the Provided set. All Passes now finally just automatically
provide themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3124 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 21:03:33 +00:00
Chris Lattner
44050fb25a * PassInfo is allowed to be missing now (ie, not all passes need be registered)
* getPassName uses PassInfo if it's available
* PassInfo is now cached in the pass so that it is only looked up once, maximum


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3123 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 21:02:31 +00:00
Chris Lattner
a59cbb2043 * Standardize how analysis results/passes as printed with the print() virtual
methods
* Eliminate AnalysisID:  Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
  the analyses themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3116 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-27 01:12:17 +00:00
Chris Lattner
a6275ccdf5 * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3113 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 21:12:46 +00:00
Chris Lattner
1e43516dcf * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3112 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 21:12:44 +00:00
Chris Lattner
ce6ef112c4 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3105 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 18:40:14 +00:00
Chris Lattner
c1b2718acf Fix typeo that caused bug:
test/Regression/Assembler/2002-07-25-ReturnPtrFunction.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3103 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 20:58:51 +00:00
Chris Lattner
54d10c8715 Fix bug: test/Regression/Assembler/2002-07-25-QuoteInString.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3099 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 20:32:37 +00:00
Chris Lattner
b2e80a6951 Avoid warning: control reaches end of non-void function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3081 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 15:39:05 +00:00
Chris Lattner
b1443b1749 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3072 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 22:40:39 +00:00
Chris Lattner
fe8041ae39 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3065 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 22:08:53 +00:00
Chris Lattner
e20a5dd343 Register Verifier pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3019 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:08:17 +00:00
Chris Lattner
54bbdb4677 Add support for pass registration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3018 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:08:00 +00:00
Chris Lattner
f082b80828 Register Writer passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3017 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 18:07:49 +00:00
Chris Lattner
56d27019e6 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-23 17:52:38 +00:00
Chris Lattner
5ff62e90d0 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2985 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-22 02:10:13 +00:00
Chris Lattner
e306d94782 * Rewrite loop to be slightly more efficient (arguably)
* Fix a MAJOR thinko that was causing bad links to happen on Spec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2953 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 02:31:03 +00:00
Chris Lattner
6183b92b2c * ConstExpr::getelementptr now takes a vector of Constants not Values
* Assert things instead of printing an error and returning null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2949 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:14:50 +00:00
Chris Lattner
3535c9b387 Add a hack to check for a subset of true dominance properties
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2947 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:13:42 +00:00
Chris Lattner
6cdf1971bd Implement linking of ConstExprs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2946 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-18 00:13:08 +00:00
Anand Shukla
4d2da0d7a7 added std:: to cerr and endl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2914 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-16 00:02:17 +00:00
Vikram S. Adve
d0b1bb01f2 Ensure ConstExpr constants are unique using a
map of <opcode, operands> to ConstExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2909 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-15 18:19:33 +00:00
Vikram S. Adve
b4dbb4445c Added support to write out ConstantExpr nodes.
Also, avoid asserting out when writing out an invalid tree
since the assembly writer is used when debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2902 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:14:45 +00:00
Vikram S. Adve
345e0cfb86 Added subclass ConstantExpr to represent expressions consructed from
constants using operators such as cast, getelementptr, add, shl, etc.
Note that a ConstantExpr can be of any type, so classof() in most
other subclasses (that discriminate by type) have to check that it
is also not a ConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2901 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:13:17 +00:00
Vikram S. Adve
c105645c16 Create a static version of Instruction::getOpcodeName(opCode) that
can be invoked with only an opcode (i.e., without an instruction).
Move all opCode->opCodeName translations there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2900 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-14 23:09:40 +00:00
Chris Lattner
607dc6880e *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2852 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-10 16:48:17 +00:00
Vikram S. Adve
08272fbdb2 Moved MachineCodeForBB to be an annotation on BasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2818 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-08 22:31:11 +00:00
Chris Lattner
3e009942ed *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2813 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-30 16:25:25 +00:00
Anand Shukla
d05e22cb6f changes for 64bit gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2801 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 22:07:38 +00:00
Anand Shukla
60a786e9e9 added include<iostream> for cerr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2800 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 22:04:00 +00:00
Chris Lattner
7e70829632 MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:13:24 +00:00
Chris Lattner
18961504fc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 16:12:52 +00:00
Chris Lattner
24e845fa95 * Update to work with Megapatch
* Add two new checks:
  * PHI nodes must be the first thing in a basic block, all grouped together
  * All basic blocks should only end with terminator insts, not contain them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2773 91177308-0d34-0410-b5e6-96231b3b80d8
2002-06-25 15:56:27 +00:00
Chris Lattner
9e77f77687 Support opaque type printing a little bit at least
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2748 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-26 20:17:54 +00:00
Chris Lattner
89d46b0f09 Fix bug: test/Regression/Transforms/ADCE/2002-05-23-ZeroArgPHITest.ll
Which contains a description of why this is neccesary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2733 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-23 16:52:34 +00:00
Chris Lattner
0c51266082 Avoid creating the symbol table if we don't need it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2728 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 22:53:05 +00:00
Chris Lattner
68e0278815 Print out function name with % style instead of "" style
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2726 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-22 22:29:26 +00:00
Chris Lattner
87a09b10f8 Fix bug: test/Regression/Transforms/CFGSimplify/2002-05-21-PHIElimination.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2694 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-21 19:52:49 +00:00
Chris Lattner
afc38686b4 Avoid emitting a useless comment for a basic block with no uses (which
often happens for the entry basic block of a function)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2624 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-14 16:02:05 +00:00
Chris Lattner
ef704a23b4 Add method to check to see if two _Instructions_ dominate each other
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2616 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-13 22:03:16 +00:00
Chris Lattner
d6b60805e8 We actually need this code for the release build to prevent link errors,
un#ifdef it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2606 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-10 18:54:35 +00:00
Chris Lattner
56732fb869 Verify that function call arguments match the function signature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2553 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-08 19:49:50 +00:00
Chris Lattner
54753e2790 Implement constant propogation of PHI instructions like this:
X = phi(0, 0, 0)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2543 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 20:44:59 +00:00
Chris Lattner
fc514f40a6 Move UnifyFunctionExitNodes to Utils library: final resting place this time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2531 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 19:18:48 +00:00
Chris Lattner
c8cc4cb03b Updates to move some header files out of include/llvm/Transforms into
the Scalar and Utils subdirectories


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2523 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:36:35 +00:00
Chris Lattner
07a228d1f7 Mark analyses that only depend on the CFG of a function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2507 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 19:32:07 +00:00
Chris Lattner
27ad137d5e Make functions that preserve the CFG not invalidate analyses that only depend
on the CFG of a function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2506 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 19:31:52 +00:00
Chris Lattner
a803899af5 Move a bunch of code to a .cpp file, don't #include Instruction.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2499 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:54:50 +00:00
Chris Lattner
178414c3cf Move code out of header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2498 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 17:54:27 +00:00
Chris Lattner
9b625030c8 Replace all usages of Type::isPointerType with isa<PointerType>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:15:30 +00:00
Chris Lattner
d44023ecb7 Implement getPrimitiveSize()
don't use isPointerType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2485 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 16:14:39 +00:00
Chris Lattner
4c1061f58c Implement constant propogation of shift instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2471 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 03:01:37 +00:00
Chris Lattner
cf4929fa27 Implement constant propogation of shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2470 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 03:00:54 +00:00
Chris Lattner
03e2acb37f Print functions with curly braces instead of begin/end
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2469 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 03:00:40 +00:00
Chris Lattner
cb6d70c6e0 Implement two iterator remove method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2467 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-06 02:59:34 +00:00
Chris Lattner
44540ddaa0 Implement remainder
Fix implementation of Not


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2464 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-03 21:41:07 +00:00
Chris Lattner
bdd15ad565 Implement remainder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2463 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-03 21:40:37 +00:00
Chris Lattner
905f311d05 Fix bug: test/Regression/Transforms/SCCP/2002-05-03-NotOperator.ll
by using the ~ operator instead of !


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2458 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-03 20:09:52 +00:00
Chris Lattner
b05ca44eb9 The implementation keyword is no longer neccesary
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2434 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 19:11:29 +00:00
Chris Lattner
ee37bb34d1 Fix problem where subpasses would invalidate all analyses outstanding
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2418 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-30 18:50:17 +00:00
Chris Lattner
ea1e8c70eb Make the range insert operation return an iterator, even though the STL
range insert doesn't


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2413 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 21:23:30 +00:00
Chris Lattner
3eb59c0074 Changes so that iMemory.h doesn't include DerivedTypes.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2404 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 18:46:50 +00:00
Chris Lattner
c6f3ae5c66 Eliminate duplicate or unneccesary #include's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 17:42:12 +00:00
Chris Lattner
96c466b06a Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 14:57:45 +00:00
Chris Lattner
691fa3cfb1 Add a new command line option for PassManager using utilities.
Now for llc, gccas, analyze, opt, etc you can specify the -time-passes
command line option that outputs a timing summary report that indicates
how long each pass takes to execute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2394 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 04:04:29 +00:00
Chris Lattner
9d73279ec8 Todo has been implemented, remove it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2387 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 21:45:02 +00:00
Chris Lattner
97e52e4336 Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2386 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 21:27:06 +00:00
Chris Lattner
3330e5be7a Move FunctionPass::doesNotModifyCFG to AnalysisUsage::preservesCFG()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2384 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 21:25:41 +00:00
Chris Lattner
d30efaf56e * Add a stub to FunctionPass so that subclasses can declare that they do not
modify the CFG.  It currently does nothing, but will in the future.
* Changes to make the public PassManager.h be MUCH smaller, and devoid of
  implementation details.  Now PassManager is just a Pimpl class that wraps
  PassManagerT<Module>, but lib/VMCore/Pass.cpp is now the only class that
  has to #include PassManagerT.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2383 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 20:46:05 +00:00
Chris Lattner
3adc069c8b Move include/llvm/PassManager.h to lib/VMCore/PassManagerT.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2382 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 20:42:50 +00:00
Chris Lattner
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +00:00
Chris Lattner
1b7f7dc4b4 Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
to the global namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2370 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:21:30 +00:00
Chris Lattner
39dd0246bd Remove extra unused argument from CheckFailed method
Remove extraneous \n's from assert strings


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2367 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:06:24 +00:00
Chris Lattner
794caa1d2c The check to see if an external function was marked internal was not reachable!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2366 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:04:26 +00:00
Chris Lattner
2e9175a085 Minor changes to allow Modules (which are no longer Values) to work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2361 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 05:14:06 +00:00
Chris Lattner
67e08db3b9 The contents of the SymTabValue class have been incorporated into the
Module and Function classes directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2356 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 04:52:28 +00:00
Chris Lattner
11aa4770fe * Incorporate the contents of SymTabValue into Function and Module
* Module no longer subclasses Value


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2355 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 04:51:51 +00:00
Chris Lattner
5240dac674 Module's are no longer values
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2354 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 04:51:09 +00:00
Chris Lattner
a298d27808 Change the Dominator info and LoopInfo classes to keep track of BasicBlock's, not
const BasicBlocks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2337 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 00:15:57 +00:00
Chris Lattner
483e14ee04 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 07:27:19 +00:00
Chris Lattner
f57b845547 * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
  - Method is now const
  - It now takes one AnalysisUsage object to fill in instead of 3 vectors
    to fill in
  - Pass's now specify which other passes they _preserve_ not which ones
    they modify (be conservative!)
  - A pass can specify that it preserves all analyses (because it never
    modifies the underlying program)
* s/Method/Function/g in other random places as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 06:56:12 +00:00
Chris Lattner
c72114ca72 Trivial simplification of code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2325 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:26:03 +00:00