Commit Graph

5115 Commits

Author SHA1 Message Date
Alkis Evlogimenos
d6e40a6cbc Properly update #intervals statistic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10847 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 10:44:29 +00:00
Chris Lattner
f78616b339 Fix InstCombine/2004-01-13-InstCombineInvokePHI.ll, which also fixes lots
of C++ programs in Shootout-C++, including lists1 and moments, etc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10845 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 06:06:08 +00:00
Brian Gaeke
34562bab04 Don't pass anything to the IntrinsicLowering class that is not_intrinsic,
because that makes it abort. Also, fix a typo in a comment.

This checkin brought to you by the "It only takes about 30 seconds to run
ENABLE_LLI tests on Shootout on zion, even if they all dump core" fund.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 06:02:53 +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
277bafbff7 Toggle sense of flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10838 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 02:50:16 +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
Alkis Evlogimenos
9739736b94 Fix bug in LiveIntervals::Interval::overlaps and
LiveIntervals::Interval::liveAt. Both were considering the live ranges
closed in the end, when they are actually open.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10835 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 00:20:09 +00:00
Alkis Evlogimenos
5ab20273a4 Improve debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10834 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-14 00:09:36 +00:00
Alkis Evlogimenos
af25473d5e Fix miscomputation of live intervals. The catch is that registers can
be dead at the defining instruction but can only be killed in
subsequent ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10833 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 22:26:14 +00:00
Alkis Evlogimenos
1a119e2410 Remove allocatable registers vector. It is already provided by
LiveVariables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10830 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 22:10:43 +00:00
Alkis Evlogimenos
a3a6524965 Cleanup debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10824 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 21:53:20 +00:00
Chris Lattner
7446dc0c4f Finegrainify namespacification
Using the SlotCalculator is total overkill for this file, a simple map
will suffice.  Why doesn't this use the NameMangler interface?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10823 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 21:27:59 +00:00
Alkis Evlogimenos
63841bc85d Fix output of live intervals to show correctly its closed, open
ranges, i.e. [a,b)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10822 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 21:17:47 +00:00
Alkis Evlogimenos
c55640f019 Remove unneeded check (with the recent change in live variables a use
of a physical register is always dominated by a def).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10821 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 21:16:25 +00:00
Alkis Evlogimenos
b7be115140 Indentation and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10820 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 20:42:08 +00:00
Alkis Evlogimenos
f7df173e3b Fix bug introduced by previous commit: check if fixed intervals
overlap before adding their spill weight.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10819 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-13 20:37:01 +00:00
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