Commit Graph

5398 Commits

Author SHA1 Message Date
Brian Gaeke
f954326741 Remove dump-input option.
Make addPassesToEmitAssembly() look slightly more like addPassesToJITCompile().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10818 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 19:26:21 +00:00
Alkis Evlogimenos
19b6486d38 Correctly compute live variable information for physical registers
when an implicitely defined register is later used by an alias. For example:

         call foo
         %reg1024 = mov %AL

The call implicitely defines EAX but only AL is used. Before this fix
no information was available on AL. Now EAX and all its aliases except
AL get defined and die at the call instruction whereas AL lives to be
killed by the assignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10813 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 06:24:30 +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
7822c2ae07 Clean up #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10799 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:56:36 +00:00
Chris Lattner
76f7fe25d9 Fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10798 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:47:05 +00:00
Chris Lattner
7c4049c5a0 Eliminate use of ConstantHandling and ConstantExpr::getShift interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10796 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:35:11 +00:00
Chris Lattner
b6ac8bc586 Add header file I accidentally removed in teh shuffle
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10795 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:15:20 +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
5585b335e5 Remove use of the ConstantHandling interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10793 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:12:50 +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
b16689b647 Don't use ConstantExpr::getShift anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10791 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 19:08:43 +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
81ebc30089 Remove use of ConstantHandling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10789 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:35:03 +00:00
Chris Lattner
e5d4f1b9e7 Remove unneeded #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10788 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:33:54 +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
8f90b005d6 Move llvm::ConstantFoldInstruction from VMCore to here, next to ConstantFoldTerminator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10785 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:25:22 +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
ccd3a878d0 Remove uses of ConstantHandling itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10783 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:12:44 +00:00
Chris Lattner
d4d4ab58ef Eliminate use of ConstantHandling itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10782 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:08:18 +00:00
Chris Lattner
e9028638bf Remove use of ConstantHandling itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10781 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 18:02:15 +00:00
Chris Lattner
6eb88d44c9 Eliminate use of ConstantHandling itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10780 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 17:57:32 +00:00
Chris Lattner
b7a5d3edee Use constantexprs for casts. Eliminate use of the ConstantHandling interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10779 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 17:43:40 +00:00
Chris Lattner
84831642e4 Fix fairly severe bug in my last checking where we treated all unfoldable
constants as being "true" when evaluating branches.  This was introduced
because we now create constantexprs for the constants instead of failing the
fold.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10778 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 17:40:36 +00:00
Alkis Evlogimenos
f998a7e671 Output mov %REG = 0 instead of xor %REG, %REG, %REG to clear a
register so that LiveVariable analysis is not confused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10773 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 07:22:45 +00:00
Chris Lattner
c6a4d6a066 * Implement minor performance optimization for the getelementptr case
* Implement SCCP of load instructions, implementing Transforms/SCCP/loadtest.ll
  This allows us to fold expressions like "foo"[2], even if the pointer is only
  a conditional constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10767 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 04:29:41 +00:00
Chris Lattner
5f16a13896 Do not hack on volatile loads. I'm not sure what the point of a volatile load
from constant memory is, but lets not take chances.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10765 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 04:13:56 +00:00
Chris Lattner
1daee8b010 Implement SCCP/phitest.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10763 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 03:57:30 +00:00
Chris Lattner
2d11f167e6 Implement Transforms/ScalarRepl/phinodepromote.ll, which is an important
case that the C/C++ front-end generates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10761 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-12 01:18:32 +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
Alkis Evlogimenos
b08bdc4a16 Make LiveVariables::HandlePhysRegUse and
LiveVariables::HandlePhysRegDef private they use information that is
not in memory when LiveVariables finishes the analysis.

Also update the TwoAddressInstructionPass to not use this interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10755 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-11 09:18:45 +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
2cacc0a306 Update obsolete comments
Fix iterator invalidation problems which was causing -mstrip to miss some
entries, and read free'd memory.  This shrinks the symbol table of 254.gap
from 333 to 284 bytes!  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10751 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 21:36:49 +00:00
Chris Lattner
737d3cd719 Do not bother to emit a BytecodeBlock for an empty symbol table. This commonly
occurs when the symbol table for a module has been stripped, making all of the
function local symbols go away.

This saves 6728 bytes in the stripped bytecode file of 254.gap (which obviously
has 841 functions), which isn't a ton, but helps and was easy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10750 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:56:59 +00:00
Chris Lattner
ae7fc3aede Remove use of llvm/CodeGen/InstrSelection.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10749 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:16:26 +00:00
Chris Lattner
74b1f45293 Remove config wrapper around <cerrno>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10747 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:15:14 +00:00
Chris Lattner
32abce6e3a Err, we don't need Config/*.h files for things that are standard C++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10742 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:10:01 +00:00
Chris Lattner
1499934c64 minor comment tweaks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10741 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:07:06 +00:00
Chris Lattner
3446ae8337 * finegrainify namespacification of ArchiveReader.cpp
* Refactor reader stuff out of include/llvm/Bytecode/Primitives.h.  This is
  internal implementation details for the reader, not public interfaces!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10739 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:00:15 +00:00
Chris Lattner
4443019b7d Refactor writer stuff out of include/llvm/Bytecode/Primitives.h. This is
internal implementation details for the writer, not public interfaces!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10738 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 18:56:59 +00:00
Chris Lattner
44f549b4eb Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10737 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 18:49:43 +00:00
Chris Lattner
b3da2fd16f Live var is now in lib/Target/Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10735 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 18:16:20 +00:00
Chris Lattner
12023d67f8 Move sparc-specific code into lib/Target/Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10734 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 18:15:56 +00:00
Chris Lattner
9982e211ce Move sparc-specific livevar code into lib/Target/Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10733 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 18:15:24 +00:00
Chris Lattner
1d415a967b Fix more incestuous #includage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10732 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 16:17:09 +00:00
Chris Lattner
d5da197071 Finegrainify namespacification.
This should get hunked over to the Sparc backend, along with
MachineCodeForInstruction and a bunch of files in include/llvm/Codegen,
but those battles will have to wait for a later time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10731 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:30:18 +00:00
Chris Lattner
2abcf524a1 Move InstrSelection into lib/Target/Sparc, as it's sparc specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10730 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:24:06 +00:00
Chris Lattner
46de01e0c8 Move InstrSelection into lib/Target/Sparc, as it's sparc specific. This
makes the incestuous #include'ing of sparc internal headers much less
disturbing.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10729 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:22:34 +00:00
Chris Lattner
75e260990d Move lib/Codegen/RegAlloc into lib/Target/Sparc, as it is sparc specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10728 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:17:12 +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
21949d9088 Remove dependence on structure index type. s/MT/FT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10726 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:02:51 +00:00
Chris Lattner
d745602662 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10725 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:02:20 +00:00
Chris Lattner
559d519549 Finegrainify namespacification
add flags for PR82


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10724 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 05:53:38 +00:00
Chris Lattner
63a917bbc2 Inching towards fixing PR82
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10722 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 05:44:50 +00:00
Chris Lattner
258b5375b4 Inching our way towards fixing PR82
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10721 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 05:42:34 +00:00
Chris Lattner
329c1c6c94 Improve encapsulation in the Loop and LoopInfo classes by eliminating the
getSubLoops/getTopLevelLoops methods, replacing them with iterator-based
accessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10714 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-08 00:09:44 +00:00
Alkis Evlogimenos
7d629b50a5 Add a separate list of fixed intervals. This improves the running time
of the register allocator as follows:

       before   after
mesa   2.3790  1.5994
vpr    2.6008  1.2078
gcc    1.9840  0.5273
mcf    0.2569  0.0470
eon    1.8468  1.4359
twolf  0.9475  0.2004
burg   1.6807  1.3300
lambda 1.2191  0.3764

Speedups range anyware from 30% to over 400% :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10712 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-07 09:20:58 +00:00
Alkis Evlogimenos
1283d86b63 Minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10711 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-07 05:31:12 +00:00
Alkis Evlogimenos
75ca6a3e82 Remove declared but undefined method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10710 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-07 02:29:33 +00:00
Alkis Evlogimenos
80b378cf7c Change implementation of LiveIntervals::overlap(). This results in a
30-50% decrease in running time of the linear scan register allocator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10707 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-07 01:45:58 +00:00
Alkis Evlogimenos
d2c39e991e Pass std::string to constructor as const reference to avoid multiple
copies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10705 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-06 09:16:02 +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
Brian Gaeke
c2376a0464 Fix some typos and copy-and-paste-os in comments, and doxygenify.
Add <csignal> so that this file compiles on Solaris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10697 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 17:22:52 +00:00
Alkis Evlogimenos
63caedf046 Remove simple coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10695 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 08:24:57 +00:00
Chris Lattner
60a57584f6 /me slaps forehead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10693 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 05:45:25 +00:00
Chris Lattner
8c2403631b fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10692 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 05:42:17 +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
6dddfff750 Add new dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10686 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 05:25:59 +00:00
Chris Lattner
2eacf26aa6 Initial checkin of the LLVM source-level debugger. This is still not finished,
by any stretch of the imagination, but it is pretty cool and works :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10685 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 05:25:10 +00:00
Alkis Evlogimenos
271bd2d7f1 Currently we cannot handle two-address instructions of the form:
A = B op C where A == C, but this cannot really occur in practice
because of SSA form. Add an assert to check that just to be safe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10682 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 02:25:45 +00:00
Alkis Evlogimenos
50c047d159 Update description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10681 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-04 23:09:24 +00:00
John Criswell
2657aecfe2 Not all platforms supports sighandler_t, so I changed it to use the older
return value from signal() (which should be the same type; it's just not
typedef'd).
This fixes the build on Solaris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10675 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-01 15:14:28 +00:00
Chris Lattner
55d86482bd Add new ExecutionEngine::getGlobalValueAtAddress method, which can efficiently
turn a memory address back into the LLVM global object that starts at that
address.  Note that this won't cause any additional datastructures to be built
for clients of the EE that don't need this information.

Also modified some code to not access the GlobalAddress map directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10674 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 20:21:04 +00:00
Chris Lattner
9e26027b82 * Add a new helper progress method
* Make sure that the user sees the 100% mark
* Don't bother printing out X.0%, just print out X%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10672 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 10:20:38 +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
0a5f0334ff Add missing #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10669 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 07:31:10 +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
81a085a259 Add new function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10664 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 06:15:37 +00:00
Chris Lattner
a2e9363617 New class, useful for command-line interactive programs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10662 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 05:40:02 +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
c7d3f6b6bf Minor code cleanups. The only bugfix is to the UR_DEBUG stuff which didn't
compile when enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10657 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-31 02:18:11 +00:00
Chris Lattner
f63aeece6f remove some useless #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10654 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-30 07:55:21 +00:00
Chris Lattner
b70abe1c5a Use new getFileSize function instead of sys/stat.h directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10650 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-30 07:40:35 +00:00
Chris Lattner
316cb083d6 Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10649 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-30 07:36:14 +00:00
Chris Lattner
9899ae3ae8 Further revisions of the FDHandle idea. In this version we use ownership
semantics that are the same as those used by std::auto_ptr.  This allows
copying of FDHandle's, but copying transfers ownership.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10646 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-30 02:45:16 +00:00
Chris Lattner
9b448b703f Add trivial exception specs to produce better code since the methods cannot
be inlined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10643 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-29 21:43:58 +00:00
Chris Lattner
2d6481cc2a Factor FDHandle out of the bytecode reader into the FileUtilities.h support
routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10642 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-29 21:35:05 +00:00
Chris Lattner
872ccce0a8 implement new getToken function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10639 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-29 05:07: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
Alkis Evlogimenos
27490a6fcc Reserve ECX and EDI instead of EBX and EDI. Since EBX is a callee
saved register it has a longer free range than ECX (which is defined
every time there is a fnuction call) which makes ECX a better register
to reserve.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10635 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 18:03:52 +00:00
Alkis Evlogimenos
26bfc08b80 Add coalescing to register allocator. A hint is added to each interval
which denotes the register we would like to be assigned to (virtual or
physical). In register allocation, if this hint exists and we can map
it to a physical register (it is either a physical register or it is a
virtual register that already got assigned to a physical one) we use
that register if it is available instead of a random one in the free
pool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10634 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 17:58:18 +00:00
Alkis Evlogimenos
5e30002af7 Add TargetInstrInfo::isMoveInstr() to support coalescing in register
allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10633 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 17:35:08 +00:00
Chris Lattner
aed386e6b0 Whoops, don't try to lower non intrinsic calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10632 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:53:23 +00:00
Chris Lattner
4482715f3d implement support for the intrinsic lowering functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10629 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:47:19 +00:00
Chris Lattner
37b1826aab Eliminate some code that is not needed now that we have the intrinsic lowering pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10628 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:46:33 +00:00
Chris Lattner
7301178aac Pass around IntrinsicLowering instances as appropriate.
Reimplement the Interpreters implementation of va_* to be more direct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10627 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:44:37 +00:00
Chris Lattner
f8742b3e03 Use the intrinsic lowering functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10626 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:43:35 +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
aa4c91ff96 finegrainify namespacification
minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10619 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 07:59:53 +00:00
Chris Lattner
0898c78a52 Merging constants can cause further room for improvement. Iterate until
we converge


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10618 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 07:19:08 +00:00
Chris Lattner
6cdc42b3d1 Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10617 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 04:03:49 +00:00
Chris Lattner
87f03108f2 Factor code out of LLI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10616 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-26 06:50:30 +00:00
Chris Lattner
ddceeb720d minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10612 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-26 06:16:00 +00:00
Chris Lattner
ff0f1bb32a No longer run atExit functions from run()
rename run to runFunction
Genericize the runFunction code a little bit, though it still stinks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10610 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-26 06:13:47 +00:00
Chris Lattner
2cab55d7e1 No longer run atExit functions from run()
rename run to runFunction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10609 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-26 06:13:05 +00:00
Alkis Evlogimenos
843397c237 Improve debugging output when choosing a register to spill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10604 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-24 18:53:31 +00:00
Alkis Evlogimenos
7a40eaacee Do a separate pass to compute spill weights because doing it inline
with live intervals was missing registers that were used before they
were defined (in the arbitrary order live intervals numbers
instructions).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10603 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-24 15:44:53 +00:00
Chris Lattner
9cd42575c2 Right, fix the problem with invoke instructions, not just call instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10599 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 22:18:36 +00:00
Chris Lattner
f64d57ada8 Do not delete the type holder until after the call instruction has been
constructed!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10598 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 20:39:17 +00:00
John Criswell
368751f2b7 Modified the logic so that library objects with main() are only linked in
if the program currently has main undefined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10597 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 20:27:14 +00:00
Chris Lattner
a989b234bd Minor cleanups, plug a minor memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10596 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 20:05:15 +00:00
Alkis Evlogimenos
3bf564a95f Change the way free regusters are computed and perform better
allocation in the presence of preallocated intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10595 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 18:00:33 +00:00
John Criswell
1715ce00e4 Modified the linker so that it always links in an object from an archive
that defines the symbol "main."  This is a hack that ensures that programs
that place their main function in a library and then link it in
(i.e. Apache 2.x) get their main function linked in.

There is probably a more correct way to do this, but this works for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10594 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 17:37:06 +00:00
Chris Lattner
9a0a41f224 rename ClassifyExpression -> ClassifyExpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10592 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 08:04:08 +00:00
Chris Lattner
15cad759fe More minor non-functional changes. This now computes the exit condition, though
it doesn't do anything with it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10590 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 07:47:09 +00:00
Chris Lattner
e799902fbb Remove extraneous #include
finegrainify namespacification


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10589 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 07:43:38 +00:00
Chris Lattner
790462ca1f Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10588 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 06:44:41 +00:00
Chris Lattner
b97238079d Fix memory corruption bug PR193
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10586 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 23:49:36 +00:00
John Criswell
9059158b56 Reverted back to revision 1.11. The previous fix doesn't really fix
anything; it just causes the bug to go dormant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10585 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 16:22:49 +00:00
Alkis Evlogimenos
056063e264 Fix crash when compiling twolf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10584 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 13:54:29 +00:00
Chris Lattner
500597a1c3 Don't mind me, I'm just refactoring away. This patch makes room for LFTR, but
contains no functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10583 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 09:53:29 +00:00
Chris Lattner
4c307d4a90 finegrainify namespacification
Implement indvar analysis of getelementptr and sub expressions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10582 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 05:26:29 +00:00
Chris Lattner
18b3c97bc7 Implement IndVarsSimplify/pointer-indvars.ll, transforming pointer
arithmetic into "array subscripts"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10580 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 05:02:01 +00:00
Chris Lattner
f045328dd1 finegrainify namespacification
add new getIntPtrType() method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10579 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 05:01:15 +00:00
Chris Lattner
3324e718bc Fix PR194
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10573 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 03:58:44 +00:00
Misha Brukman
3615845b3e Really release memory used by functions. Patch by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10572 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 03:47:58 +00:00
Alkis Evlogimenos
4de1fefd7c Remove verifyIntervals() since it doesn't actually work right now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10570 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-21 20:41:26 +00:00
Alkis Evlogimenos
6b4edbaaf9 Change weight into a float so that we can take into account the
nesting level when computing it. Right now the allocator uses:

    w = sum_over_defs_uses( 10 ^ nesting level );


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10569 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-21 20:19:10 +00:00
Alkis Evlogimenos
0ef76cadbb Move FP_REG_KILL closer to the return instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10567 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-21 16:47:43 +00:00
Alkis Evlogimenos
169cfd0196 Add support for inactive intervals. This effectively reuses registers
for live ranges that fall into assigned registers' holes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10566 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-21 05:43:40 +00:00
John Criswell
1118d0fd94 Fix PR#193.
Modified ReadArchiveBuffer() so that it dynamically allocates the
std::string object used to hold the bytecode object file's name.  This is
necessary because it is passed by reference to the new Module that is
allocated to represent the bytecode object, and previously we were
using a std::string that disappeared on function exit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10565 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 22:37:29 +00:00
Alkis Evlogimenos
9abc81790e Move FP_REG_KILL closer to the actual branch instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10563 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 17:28:15 +00:00
Alkis Evlogimenos
e0bb3e766d Remove floating point killer pass. This is now implemented in the
instruction selector by adding a new pseudo-instruction
FP_REG_KILL. This instruction implicitly defines all x86 fp registers
and is a terminator so that passes which add machine code at the end
of basic blocks (like phi elimination) do not add instructions between
it and the branch or return instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10562 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 16:22:59 +00:00
Chris Lattner
16c45e9de8 Add a new target-independent machine code freeing pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10560 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 10:20:58 +00:00
Chris Lattner
655239cc6b Finally, _actually delete the machine code_ for a function, after it has
been emitted.  Also, since the FPK pass is causing memory access violations,
disable it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10559 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 10:20:19 +00:00
Chris Lattner
028565b14b This should not be needed anymore
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10558 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 10:19:18 +00:00
Chris Lattner
9068574a29 Fix memory leak in the stackifier, due to the machinebasicblocks not holding
instructions on an ilist


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10556 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 10:12:17 +00:00
Chris Lattner
f2e49d4c1a Finegrainify namespacification
Minor cleanups to killer pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10555 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 09:58:55 +00:00
Chris Lattner
583b9d8455 Hoist some sparc specific code into the sparc target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10554 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 09:17:40 +00:00
Chris Lattner
07f32d48f1 * Finegrainify namespacification
* Move sparc specific code out of generic code
* Eliminate the getOffset() method which made INVALID_FRAME_OFFSET
  necessary, which made pulling in MAX_INT as a sentinal necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10553 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 09:17:07 +00:00
Chris Lattner
61838824c2 Remove a horrible API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10551 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 09:15:01 +00:00
Chris Lattner
c07ed13875 Implement PR135, lazy emission of global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10549 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 03:36:47 +00:00
Chris Lattner
24b0a18c43 Simple refactorings to prepare for lazy global emission
Also, add a stat for the number of globals emitted


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10547 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 02:45:37 +00:00
Chris Lattner
2828970819 A minor cleanup for better encapsulation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10545 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 02:03:14 +00:00
Chris Lattner
4d326fa9be Cleanup the JIT as per PR176. This renames the VM class to JIT, and merges the
VM.cpp and JIT.cpp files into JIT.cpp.  This also splits some nasty code out
into TargetSelect.cpp so that people hopefully won't notice it.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10544 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 01:46:27 +00:00
Chris Lattner
61612df9cb Update for changes in the JIT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10543 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 01:45:17 +00:00
Chris Lattner
1e60a9165d Rip JIT specific stuff out of TargetMachine, as per PR176
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10542 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 01:22:19 +00:00
Chris Lattner
bd1a90ecc7 Fix ADCE/2003-12-19-MergeReturn.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10539 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 09:08:34 +00:00
Chris Lattner
a3df8a964a Remove the wierd "Operands" loop, by traversing basicblocks in reverse order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10536 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 08:18:16 +00:00
Chris Lattner
e4365b2e8c Implement LICM/sink_multiple.ll, by sinking all possible instructions in the
loop before hoisting any.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10534 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 07:22:45 +00:00
Chris Lattner
0f98e75adf Generalize a special case to fix PR187
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10531 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 06:27:08 +00:00
Chris Lattner
60921c9aa1 Factor code out into the Utils library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10530 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 05:58:40 +00:00
Chris Lattner
abbc2dd779 Add new function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10529 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-19 05:56:28 +00:00
Alkis Evlogimenos
4c080863de Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10520 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 22:40:24 +00:00
Chris Lattner
5e46b513f3 Prune some #includes
Add a statistic for # reloads


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10518 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 20:25:31 +00:00
John Criswell
47df12d80d Reverted back to previous revision - this was previously merged
according to the CVS log messages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10517 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 17:19:19 +00:00
John Criswell
d000e1dc2f Merged in RELEASE_11.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10516 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 16:43:17 +00:00
Alkis Evlogimenos
a71e05acdd Modify linear scan register allocator to use the two-address
instruction pass. This also fixes all remaining bugs for this new
allocator to pass all tests under test/Programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10515 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 13:15:02 +00:00
Alkis Evlogimenos
a3d0e5c2b2 Fix bug in reserved registers. DH actually aliases DX and EDX which
are not reserved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10514 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 13:12:18 +00:00
Alkis Evlogimenos
9af9dbde7d Modify local register allocator to use the two-address instruction pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10513 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 13:08:52 +00:00
Alkis Evlogimenos
71499ded4d Add TwoAddressInstructionPass to handle instructions that have two or
more operands and the two first operands are constrained to be the
same. The pass takes an instruction of the form:

        a = b op c

and transforms it into:

        a = b
        a = a op c

and also preserves live variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10512 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 13:06:04 +00:00
Alkis Evlogimenos
485ec3c21e Rename LiveIntervals::expired() to LiveIntervals::expiredAt().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10511 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 08:56:11 +00:00
Alkis Evlogimenos
43f692f90f When a variable is killed and redifined in a basic block only one
killing instruction is tracked. This causes the LiveIntervals to
create bogus intervals. The workaound is to add a range to the
interval from the redefinition to the end of the basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10510 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 08:53:43 +00:00
Alkis Evlogimenos
dd2cc65f34 Handle multiple virtual register definitions gracefully.
Move some of the longer LiveIntervals::Interval method out of the
header and add debug information to them. Fix bug and simplify range
merging code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10509 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 08:48:48 +00:00
Chris Lattner
ba7df4c482 When we delete instructions from the loop, make sure to remove them from the
AliasSetTracker as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10507 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 08:12:32 +00:00
Chris Lattner
2cffeec014 Add a new AliassetTracker::remove method. Because we need to be able to remove
a pointer from an AliasSet, maintain the pointer values on a doubly linked
list instead of a singly linked list, to permit efficient removal from the
middle of the list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10506 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 08:11:56 +00:00
Misha Brukman
97f9cf2de2 * Converted C-style comments to C++
* Doxygenified comments
* Reordered #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10503 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-17 22:08:20 +00:00
Misha Brukman
3d0ad411a5 Reordered #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10502 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-17 22:06:28 +00:00
Misha Brukman
c3402cd735 Doxygenified some comments, reduced extraneous space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10501 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-17 22:06:08 +00:00
Misha Brukman
d71295a684 Reorganized the Sparc backend to be more modular -- each different
implementation of a Target{RegInfo, InstrInfo, Machine, etc} now has a separate
header and a separate implementation file.

This means that instead of a massive SparcInternals.h that forces a
recompilation of the whole target whenever a minor detail is changed, you should
only recompile a few files.

Note that SparcInternals.h is still around; its contents should be minimized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10500 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-17 22:04:00 +00:00
Brian Gaeke
6ca5b8f5f4 Make getObjectType() smarter about ranlibbed Mac OS X archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10493 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-17 00:18:18 +00:00
Chris Lattner
9e45d2e0e8 Fix for PR185 & IndVarsSimplify/2003-12-15-Crash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10473 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-15 17:34:02 +00:00
Alkis Evlogimenos
f6f91bf668 Change preserve all claim to just preserve live variables and phielimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10469 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-15 04:55:38 +00:00
Chris Lattner
d64152a708 Refactor code just a little bit, allowing us to implement TailCallElim/return_constant.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10467 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 23:57:39 +00:00
Chris Lattner
f7a743d7ed Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10465 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 23:25:48 +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
b6d465f813 Finegrainify namespacification
Make the Timer code give correct user/system/user+system times when -track-memory is enabled


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10463 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 21:27:33 +00:00
Alkis Evlogimenos
4d7af65903 Change interface of MachineOperand as follows:
a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
    b) add isUse(), isDef()
    c) rename opHiBits32() to isHiBits32(),
              opLoBits32() to isLoBits32(),
              opHiBits64() to isHiBits64(),
              opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10461 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 13:24:17 +00:00
Alkis Evlogimenos
97323a47d8 Change preserve all claim to just preserve live variables and phielimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10460 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 10:14:23 +00:00
Chris Lattner
00ad4a2d17 Do not promote volatile alias sets into registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10458 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 04:52:31 +00:00
Chris Lattner
e26092456a Finegrainify namespacification
Add capability to represent volatile AliasSet's
Propagate this information from loads&stores into the aliassets


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10457 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-14 04:52:11 +00:00
Alkis Evlogimenos
94743e4915 When reserving a preallocated register spill the aliases of this
register too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10450 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-13 11:58:10 +00:00
Alkis Evlogimenos
4c214d2bf0 Ignore non-allocatable physical registers in live interval analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10449 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-13 11:11:02 +00:00
Alkis Evlogimenos
7d65a12fe6 Expire any active intervals left when register allocation is done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10448 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-13 05:50:19 +00:00
Alkis Evlogimenos
f6e610c27d Add instruction numbers to debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10447 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-13 05:48:57 +00:00
Alkis Evlogimenos
359b65f782 Add a floating point killer pass. This pass runs before register
allocaton on the X86 to add information to the machine code denoting
that our floating point stackifier cannot handle virtual point
register that are alive across basic blocks. This pass adds an
implicit def of all virtual floating point register at the end of each
basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10446 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-13 05:36:22 +00:00
Alkis Evlogimenos
9435eda699 Handle explicit physical register defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10445 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-13 05:26:39 +00:00
Alkis Evlogimenos
efe995a406 Remove unecessary if statements when looping on ImplicitDefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10444 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-13 01:20:58 +00:00
John Criswell
52b62de100 Modified cast so that it converts the int to a long before casting to
a pointer.  This evades a warning emitted by GCC when we cast from
unsigned int (32 bit) to void * (64 bit) on SparcV9.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10435 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 19:57:48 +00:00
Brian Gaeke
6c9d582738 Dynamically get the right-sized member of a GenericValue to hold a size_t, and
use it to return the result of strlen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10433 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 15:38:06 +00:00
Chris Lattner
993bdcec00 Implement the ExecutionEngine::getPointerToFunctionOrStub by forwarding the
request on to the TargetMachine if it supports the getJITStubForFunction method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10431 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 07:12:02 +00:00
Chris Lattner
65b05ce022 Implement the TargetMachine::getJITStubForFunction method for X86, finegrainify
namespacification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10430 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 07:11:18 +00:00
Brian Gaeke
2798cd077a Since we are using a gep_type_iterator, we apparently must get the type
index by using I.getOperand() here. This was failing an assertion on
basically every struct access.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10426 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 05:13:05 +00:00
Brian Gaeke
27b40bcc9c Throw better error messages, by calling strerror(errno) when we
get an error inside the bytecode reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10415 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-12 00:47:44 +00:00
Chris Lattner
4a83088b30 Factor out some duplicated code, implement the rest of the cases in
BasicAA/2003-12-11-ConstExprGEP.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10412 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 23:20:16 +00:00
Chris Lattner
b307c88fe7 Fix PR86. This makes basicaa _SIGNIFICANLY_ more aggressive with getelementptr's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10410 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 22:44:13 +00:00
Chris Lattner
ea9403f2aa Fix LICM/2003-12-11-SinkingToPHI.ll, and quite possibly all of the other known problems in the universe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10409 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 22:23:32 +00:00
Chris Lattner
1ca2a583cb Finegrainify namespacification
Add new -print-cfg-only pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10407 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 21:48:18 +00:00
Chris Lattner
1301515197 verifyFunction depends on dominator info, which levelraise does not declare
that it needs.  This is pretty scary code!  This fixes

Regression.Transforms.LevelRaise.2002-07-16-SourceAndDestCrash
Regression.Transforms.LevelRaise.2002-07-31-AssertionFailure


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10406 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 21:47:37 +00:00
Chris Lattner
c54735e7cb Fix a glaring bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10400 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 06:06:28 +00:00
Chris Lattner
88d3e03429 Realize the gep P, <zeros> must aliases P.
This is a partial fix for PR 86


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10399 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 06:02:00 +00:00
Chris Lattner
863914578a With Brian's change to AA.h we can now clean out this uglyness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10398 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 05:44:59 +00:00
Brian Gaeke
8e32f5e46d IncludeFile hack to pull in BasicValueNumbering whenever ValueNumbering.h
is included.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10397 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 05:05:56 +00:00
Brian Gaeke
3c09636588 In getObjectType(), doxygenify comment, and take a pointer to the
beginning of the archive member data as an argument.

Get rid of ParseLongFilenameSection(), which is dead.

In ReadArchiveBuffer(), implement support for 4.4BSD/MacOSX long filenames.
This is kind of invasive, because they prepend the long filename to the archive
member data, and then lie about the size. So we have to keep track of the real
size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10392 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 00:38:04 +00:00
Brian Gaeke
27f7a71a25 Turn off "attribute weak" to pacify Mac OS X's system compiler, which prints a
warning whenever it sees it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10391 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 00:24:36 +00:00
Brian Gaeke
dfa58498ae Fix typo in comment. Add prototype for getConstantExprValue().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10390 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 00:23:28 +00:00
Brian Gaeke
63438cc9b0 Add support for --debug-only=interpreter, to print out instrs before
interpreting them.

Move support for getting the value of a ConstantExpr into
getConstantExprValue(), and add support for the rest of the different
kinds of ConstantExprs.  (I don't think I like ConstantExprs!)
This requires separate procedures executeShlInst() and executeShrInst().

Reduce the number of references to TheEE.

Get rid of an old comment mentioning annotations.

Fix exitCalled(), which was crashing the Interpreter. This was a
leftover from the return-value code refactoring.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10389 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-11 00:22:59 +00:00
John Criswell
f5ba89df1f This appears to fix Bug 172 and does not break any other feature tests or
regression tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10388 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 22:51:41 +00:00
Chris Lattner
7d3ced934f Fix bug: LICM/sink_multiple_exits.ll
Thanks for pointing this out John  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10387 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 22:35:56 +00:00
Chris Lattner
df45bd3803 Don't allow dead instructions to stop sinking early.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10386 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 20:43:29 +00:00
Chris Lattner
88369d214f Fix bug: IndVarsSimplify/2003-12-10-RemoveInstrCrash.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10385 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 20:43:04 +00:00
Chris Lattner
dead99325c Finegrainify namespacification
Fix bug: LowerInvoke/2003-12-10-Crash.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10382 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 20:22:42 +00:00
John Criswell
0284a42fd3 Upon Chris's suggestion, moved the #ifdef's to the generated C code.
This makes LLVM and the generated C code more portable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10377 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 18:17:57 +00:00
Chris Lattner
ba4f3f6a41 Finegrainify namespacification
Reorder #includes
Implement: IndVarsSimplify/2003-12-10-IndVarDeadCode.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10376 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 18:06:47 +00:00
John Criswell
01b2d61311 Fixed the CBE on Solaris/Sparc. We need to define the return value of
the write() system call because it returns 64 bits on Solaris 64 bit,
and an implicit return value of int says it returns 32 bits.
Admittedly, this is a bit of a hack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10375 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 18:06:34 +00:00
Chris Lattner
66ea98e85c Finegrainify namespacification
Fix bug: LoopSimplify/2003-12-10-ExitBlocksProblem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10373 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 17:20:35 +00:00
Chris Lattner
e3cfe8d563 Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10371 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 16:58:24 +00:00
Chris Lattner
f594a03197 Avoid performing two identical lookups when one will suffice
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10370 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 16:57:24 +00:00
Chris Lattner
0ed2da9ac7 Make LICM itself a bit more efficient, and make the generated code more efficient too: don't insert a store in every exit block, because a particular block may be exited to more than once by a loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10369 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 15:56:24 +00:00
Chris Lattner
381bf79ae1 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10367 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 15:34:03 +00:00
Chris Lattner
9a4f8ef787 Finegrainify namespacification
Provide a context module to WriteAsOperand


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10366 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 15:33:59 +00:00
Chris Lattner
a2706518f9 Implement instruction sinking out of loops. This still can do a little bit
better job, but this is the majority of the work.  This implements
LICM/sink*.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10358 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-10 06:41:05 +00:00
Chris Lattner
010ba10032 Do not insert one entry PHI nodes in split exit blocks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10348 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-09 23:12:55 +00:00
Chris Lattner
ed6dfc2856 Refactor code a little bit, eliminating the gratuitous InstVisitor, which
should make subsequent changes simpler.  This also allows us to hoist vaarg
and vanext instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10342 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-09 19:32:44 +00:00
Chris Lattner
92094b4d92 Fine grainify namespacification
Code cleanups
Make LICM::SafeToHoist marginally more efficient


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10341 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-09 17:18:00 +00:00
Chris Lattner
cf2f89251d Implement: TailCallElim/accum_recursion_constant_arg.ll
Also make sure to clean up any PHI nodes that are inserted which are pointless.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10333 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 23:37:35 +00:00
Chris Lattner
543d622ef7 Implement: test/Regression/Transforms/TailCallElim/accum_recursion.ll
We now insert accumulator variables as necessary to eliminate tail recursion
more aggressively.  This is still fairly limited, but allows us to transform
fib/factorial, and other functions into nice happy loops.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10332 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 23:19:26 +00:00
Chris Lattner
e63fc8b46f implement method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 08:23:04 +00:00
Chris Lattner
38f0ebad9a Use the new method, though noone currently implements it any better than before
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 08:22:48 +00:00
Chris Lattner
c19aadee66 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10318 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 08:06:28 +00:00
Chris Lattner
7152da38ef Cleanup and restructure the code to make it easier to read and maintain.
The only functionality change is that we now implement:
  Regression/Transforms/TailCallElim/intervening-inst.ll

Which is really kinda pointless, because it means that trivially dead code
does not interfere with -tce, but trivially dead code probably wouldn't be
around anytime when this pass is run anyway.

The point of including this change it to support other more aggressive
transformations when we have the analysis capabilities to do so.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-08 05:34:54 +00:00
Chris Lattner
eb12cd67dd Implement RaiseAllocations/FreeCastConstantExpr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10305 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-07 01:42:08 +00:00
Chris Lattner
67b1e1b89f * Finegrainify namespacification
* Transform: free <ty>* (cast <ty2>* X to <ty>*) into free <ty2>* X


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10303 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-07 01:24:23 +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
cd7c287730 Finegrainify namespacification
Move method out of generic dominators construction code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10299 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-07 00:35:42 +00:00
Alkis Evlogimenos
a327e7fea9 Make assertion stricter. Since the source operands are allocated at
this point, the second operand must be a physical register (it cannot
be a virtual one).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10292 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-05 11:31:39 +00:00
Alkis Evlogimenos
49787e35c3 Fix bug in register spilling when a preallocated live range overlaps a
potential register assignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10291 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-05 11:17:55 +00:00
Alkis Evlogimenos
b27ef248f5 Move operator<<(std::ostream&, const LiveInterval&) out of the header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10290 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-05 10:38:28 +00:00
Alkis Evlogimenos
91ceae6d20 Sort live intervals by increasing start point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10289 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-05 10:32:01 +00:00
Alkis Evlogimenos
69546d5f84 Improve debugging output and clean up some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-04 03:57:28 +00:00
Chris Lattner
d866473094 Finegrainify namespacification
Fix regressions ScalarRepl/basictest.ll & arraytest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10287 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-02 17:43:55 +00:00
Brian Gaeke
59e47e3ee1 Lock abstraction, introduced with a view toward making the JIT thread-safe.
Eventually.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10284 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 21:33:31 +00:00
Chris Lattner
8d1dbd2134 Emit & read more compressed bytecode by not emitting a bytecodeblock for
each basic block in function.  Instead, just emit a stream of instructions,
chopping up basic blocks based on when we find terminator instructions.  This
saves a fairly substantial chunk of bytecode space.  In stripped, sample
cases, for example, we get this reduction in size:

197.parser: 163036 -> 137180:  18.8% reduction
254.gap   : 844936 -> 689392:  22.6%
255.vortex: 621724 -> 528444:  17.7%

...

Not bad for something this simple.  :)  Note that this doesn't require a new
bytecode version number at all, though version 1.1 should not need to support
the old format.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10280 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 07:05:31 +00:00
Chris Lattner
9b527704f7 Add an option to enable the SSA based peephole optimizer.
Eventually this pass will provide substantially better code in the interim between when we
have a crappy isel and nice isel.  Unfortunately doing so requires fixing the backend to
actually SUPPORT all of the fancy addressing modes that we now generate, and writing a DCE
pass for machine code.  Each of these is a fairly substantial job, so this will remain disabled
for the immediate future.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10276 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 05:18:30 +00:00
Chris Lattner
4537076ee8 Add a new SSA-based peephole optimizer which includes copy propagation and
folding of instructions into addressing modes.  This creates lots of dead
instructions, which are currently not deleted.  It also creates a lot of
instructions that the X86 backend currently cannot handle.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10275 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 05:15:28 +00:00
Chris Lattner
f2d2925452 generalize the instruction types permitted a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10274 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-01 05:13:56 +00:00
Alkis Evlogimenos
585870759b Print instructions before register allocation is performed. Also fix
bug where spill instructions were added to the next basic block
instead of the end of the current one if the instruction that required
the spill was the last in the block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10272 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 23:40:39 +00:00
Chris Lattner
e1cc79f1cf Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10270 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 06:13:25 +00:00
Alkis Evlogimenos
99d1a8f048 Remove "numReloaded" statistic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10268 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 05:15:36 +00:00
Chris Lattner
2c0a6a19ef Emit constants to one contiguous block, but this time, respect alignment constraints.
If this doesn't work Misha, feel free to revert it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10267 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 04:23:21 +00:00
Misha Brukman
91de352796 Go back to allocating memory for each constant separately. Since SPARCs do not
allow unaligned loads, that is probably the problem I've been seeing in numerous
SPARC test cases failing. X86, on the other hand, just slows down unaligned
accesses, since it must make 2 aligned accesses for each unaligned one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10266 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-30 00:50:53 +00:00
Chris Lattner
3607f4d217 Fix test: Transforms/LevelRaise/2003-11-28-IllegalTypeConversion.ll
Some gep generalization changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10252 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-29 05:31:25 +00:00
Chris Lattner
6cc8ca9229 * The return value of LinkLibraries is ignored, so remove it.
* Finegrainify namespacification of Linker.cpp
* If linking a library in fails, do not STOP LINKING IN LIBRARIES AND
  CONTINUE ANYWAY!  Instead, just output the warning, and keep going. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10249 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-28 07:44:09 +00:00
Chris Lattner
4257098c36 To not barf when an error occurs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10236 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-26 07:24:58 +00:00
Chris Lattner
4f7e173cbd output foo(void) as appropriate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10232 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-26 00:09:17 +00:00
Chris Lattner
bc771c5608 Fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10231 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 23:44:40 +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
be883a23ed Do not use index type to determine what it is indexing into!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10226 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 21:09:18 +00:00
Chris Lattner
23e907082a Do not depend on the gep index types to determine what flavor of index it is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10225 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 20:49:55 +00:00
Chris Lattner
4af6de8f0a Do not depend on structure elements being of type UByteTy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10224 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 20:44:56 +00:00
Chris Lattner
fa3711a0f8 Do not depend on index type to determine whether it is a structure or sequential index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10221 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 20:19:55 +00:00
Chris Lattner
9d7c9ea053 Fix file header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10219 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 20:11:47 +00:00
Chris Lattner
b66214c5ad Remove dead variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10218 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 20:11:00 +00:00
Chris Lattner
1af55e1693 Use gep_type_begin/end instead of looking for ubytes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10217 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 20:10:07 +00:00
Chris Lattner
ec4e8085e8 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10210 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 18:33:40 +00:00
Chris Lattner
0b268fb75e Fix PR147
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10204 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 03:54:16 +00:00
Misha Brukman
971a7b88b5 Fix copy-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10197 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-24 05:36:38 +00:00
Misha Brukman
17cca96735 Add ability to query if a file is a legitimate ELF shared object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10193 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-24 05:28:12 +00:00
Brian Gaeke
f9c86cf5cf Support constant casting constant pointers to ints/uints, and/or
the other way around, instead of failing a large, tumor-like assertion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10171 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 07:18:25 +00:00
Brian Gaeke
dfcc9cfaa8 Constant shift expressions, meet InstSelectSimple. Yow!!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10170 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 06:49:41 +00:00
Brian Gaeke
2dd3e1b435 Stub for constant shift expr support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10168 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 05:18:35 +00:00
Brian Gaeke
0415b6c57a Fix PR149 - support constant shift expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10167 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 05:02:56 +00:00
Chris Lattner
ab25f5a6c1 Delete dead line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10164 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 02:26:17 +00:00
Chris Lattner
3788c242be Fix bug: Transforms/PruneEH/2003-11-21-PHIUpdate.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10163 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 02:20:36 +00:00
Chris Lattner
c8ecd22037 Do not crash when deleing a region with a dead invoke instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10161 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 02:13:08 +00:00
Chris Lattner
35bb52f8b1 Finegrainify namespacification
The module stripping pass should not strip symbols on external globals


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10157 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-22 01:29:35 +00:00
Misha Brukman
a59f41fc6c * Add code to flush the ICache, which any self-respecting SMC must do
* Restore registers *after* everything else to avoid any possible side effects

This fixes McCat-imp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10147 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 23:48:54 +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
6d1db01284 Considering that CI is not even IN SCOPE here, I wooda thought the compiler
would have caught this.  *sigh*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10142 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:57:29 +00:00
Chris Lattner
1e2385b941 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10138 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:54:22 +00:00
Chris Lattner
1192283096 Get rid of using decls, finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10137 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:52:10 +00:00
Chris Lattner
869adc283c * Finegrainify namespacification
* Make the cost metric for passing constants in as arguments to functions MUCH
  more accurate, by actually estimating the amount of code that will be constant
  propagated away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10136 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:46:09 +00:00
Chris Lattner
a51bcb50b0 Finegrainify namespacification
Print out the costs for functions that AREN'T inlined as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10135 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:45:31 +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
ae711a8b48 Don't crash on bogus source value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10132 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 20:27:35 +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
03fb8b2a42 * Finegrainify namespacification
* Implement FuncResolve/2003-11-20-BogusResolveWarning.ll
   ... which eliminates a large number of annoying warnings.  I know misha
   will miss them though!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10123 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 21:21:31 +00:00
Misha Brukman
84fbc653ce Add ability to search only for native shared object, and expose the
functionality to the rest of gccld.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10113 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 19:08:06 +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
143df9a1bb When spewing out warnings during function resolution, do not vomit out pages
and pages of non-symbolic types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 18:19:35 +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
Alkis Evlogimenos
ff0cbe175d Merging the linear scan register allocator in trunk. It currently passes most tests under test/Programs/SingleSource/Benchmarks/Shootout so development will continue on trunk. The allocator is not enabled by default. You will need to pass -regallo=linearscan to lli or llc to use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10103 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-20 03:32:25 +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
c2ee9b9c7a Fine grainify namespaceification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10093 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 21:08:57 +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
29b789befa * Finegrainify namespacification
* Strength reduce several data structures which were left over from the
  "bad old days"
* Minor efficiency improvements
* Major efficiency improvement: In BytecodeParser::insertValue, do not allocate
  a new ValueTab entry just because some value exists with a large type.  This
  dramatically reduces the number of allocations/deallocations performed by the
  bytecode reader, and speeds up parsing of Kimwitu++ from 34s to 17s.  This is
  to help address PR127


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10085 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 17:27:18 +00:00
Chris Lattner
8eb49936ae Minor efficiency improvements, finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10084 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 17:21:11 +00:00
Chris Lattner
c2f4b11552 In the future, these slabs can be null...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10083 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 17:20:42 +00:00
Chris Lattner
ebfb9f487d Minor efficiency improvements all over. Finegrainify Namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10082 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 17:17:36 +00:00
Chris Lattner
deab9a7ae5 Fine grainify namespacification, #include file that defines the interface!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10081 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 16:06:55 +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
1c3673b238 Minor speedup to do less linear time searches of information we already have.
speeds up disassembly of kc++ by .6s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10079 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-19 06:01:12 +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
62b767b8d7 Fix PR123
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10069 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-18 17:47:05 +00:00
Brian Gaeke
c8db76c647 Only use -Wl,-R. if HAVE_LINK_R.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10066 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-18 06:31:17 +00:00
Misha Brukman
ef7e57018d Emit the MachineConstantPool constants in one contiguous memory `pool'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10060 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 20:40:07 +00:00
Misha Brukman
0ca042db71 * Order #includes as per style guide
* Delete blank comment lines
* Eliminate space between function name and open-paren ( to be consistent


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10059 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 20:37:02 +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
Misha Brukman
444fdea19d This file was somehow missing a top-level comment line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10055 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 19:35:17 +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
02071d08c1 Remove usage of ConstantPointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10051 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-17 17:28:29 +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
2c61d7b240 Implement skeletal support for __.SYMDEF (ranlib) sections in archives.
Correctly parse the Long Filename section of the archive.
When reading in archive members, set their ModuleIDs to
 "ARCHIVENAME(MEMBERNAME)", as is traditional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10043 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 23:08:48 +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
Brian Gaeke
2282ae1ebd When we find a module we want, in an archive, in verbose mode,
print out the module's identifier (which should now contain the name
 of both the archive and the module.)
Wrap some lines at 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10039 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 23:07:13 +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
c59c118e44 ISO 9899 7.13.2.1 (3) says that "[...] the values of objects of automatic
storage duration that are local to the function containing the invocation of the
[...] setjmp macro that do not have volatile-qualified type and have been
changed between the setjmp invocation and longjmp call are indeterminate."

As such, we have to mark all variables in a function that uses 'invoke' as
volatile.

This fixes PR77


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10035 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 22:06:14 +00:00
Chris Lattner
faa45ce300 Fix PR116
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10032 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-16 21:39:27 +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
179bc7dcb1 Implement a small optimization to handling of GEP's that are equivalent to casts.
This results in substantially reduced collapsing for some testcases


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10002 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-14 17:09:46 +00:00
Chris Lattner
db9546e324 I can't believe the incompetence of the people I have to deal with around here.
These fools don't even wrap code at 80 columns.

Oh wait, _I_ wrote that.  That explains a lot!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9999 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-14 16:34:25 +00:00
Chris Lattner
8dc6ba9a12 Fix PR 110: the constant folding code assumes that if something is not a
constant expression, but is of (for example) ubyte type, then it is a
ConstantUInt.  This was not true for placeholders.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9994 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-14 06:38:46 +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