Commit Graph

1281 Commits

Author SHA1 Message Date
Chris Lattner
c7af17923e Legalize unconditional branches too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19356 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 22:12:08 +00:00
Chris Lattner
7cc4777a26 Implement support for long GEP indices on 32-bit archs and support for
int GEP indices on 64-bit archs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19354 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 21:56:57 +00:00
Chris Lattner
fd8c39b773 Simplify: truncate ({zero|sign}_extend (X))
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19353 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 21:56:24 +00:00
Chris Lattner
03c0cf822e implement legalization of a bunch more operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19352 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 21:45:56 +00:00
Chris Lattner
fad71ebe1e Fix another bug legalizing calls!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19350 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 21:35:32 +00:00
Chris Lattner
f44fd88e9c Fix handling of dead PHI nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19349 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 21:34:19 +00:00
Chris Lattner
ebda942efc Fix a bug legalizing calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19348 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 21:34:13 +00:00
Chris Lattner
62fd269c14 After legalizing a DAG, delete dead nodes to save space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19346 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 21:09:37 +00:00
Chris Lattner
0e12e6e041 Implement RemoveDeadNodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19345 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 21:09:16 +00:00
Chris Lattner
c18ae4cb6a Teach legalize how to handle condbranches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19339 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 08:19:42 +00:00
Chris Lattner
1c08c714bb Initial implementation of the SelectionDAGISel class. This contains most
of the code for lowering from LLVM code to a SelectionDAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19331 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 07:47:53 +00:00
Chris Lattner
b75c12de67 This file is obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19330 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 07:47:23 +00:00
Chris Lattner
3e928bbd61 Initial implementation of the DAG legalization. This still has a long way
to go, but it does work for some non-trivial cases now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19329 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 07:47:09 +00:00
Chris Lattner
c3aae25116 Complete rewrite of the SelectionDAG class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19327 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 07:46:32 +00:00
Chris Lattner
310968cbbb First draft of new Target interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19324 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-07 07:44:53 +00:00
Chris Lattner
cfa0f2edd3 Make the 2-address instruction lowering pass smarter in two ways:
1. If we are two-addressing a commutable instruction and the LHS is not the
   last use of the variable, see if the instruction is the last use of the
   RHS.  If so, commute the instruction, allowing us to avoid a
   register-register copy in many cases for common instructions like ADD, OR,
   AND, etc on X86.
2. If #1 doesn't hold, and if this is an instruction that also existing in
   3-address form, promote the instruction to a 3-address instruction to
   avoid the register-register copy.  We can do this for several common
   instructions in X86, including ADDrr, INC, DEC, etc.

This patch implements test/Regression/CodeGen/X86/commute-two-addr.ll,
overlap-add.ll, and overlap-shift.ll when I check in the X86 support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19245 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-02 02:34:12 +00:00
Chris Lattner
5b2103405b Move virtual method call out of loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18955 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-15 07:04:32 +00:00
Nate Begeman
80ad87d227 Move virtual function call out of loop to speed up getFreePhysReg by about
20%, shaving 0.1s off hbd compile time on my g5.  Yay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18592 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-07 05:25:53 +00:00
Reid Spencer
ce9653ce44 For PR387:\
Make only one print method to avoid overloaded virtual warnings when \
compiled with -Woverloaded-virtual


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18589 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-07 04:03:45 +00:00
Chris Lattner
ead1b3f0bb Prevent accessing past the end of the intervals vector, this fixes
Prolang-C/bison in the JIT


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18477 91177308-0d34-0410-b5e6-96231b3b80d8
2004-12-04 01:22:09 +00:00
Chris Lattner
63eb93025d Fix SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c, and hopefully
PR449


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18306 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-28 17:56:47 +00:00
Chris Lattner
cf88d324a8 Fix the FIXME, nuke the JIT specific forceCompilationOf method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18131 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 21:54:35 +00:00
Chris Lattner
6f71720be3 These methods are obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18129 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-22 21:48:33 +00:00
Chris Lattner
3bf285a676 Adjust to changed interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18064 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-20 23:53:26 +00:00
Chris Lattner
47012c0c71 Add getCurrentPCOffset() and addRelocation() methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18034 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-20 03:44:39 +00:00
Chris Lattner
45730d71b6 Match change in MachineCodeEmitter prototype.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18009 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-19 20:56:46 +00:00
Chris Lattner
c8b9f33ac0 * There is no reason for SpillWeights to be an instance var
* Do not put fixed registers into the unhandled set.  This means they will
  never find their way into the inactive, active, or handled sets, so we
  can simplify a bunch of code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17945 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 06:01:45 +00:00
Chris Lattner
9fddc12c9b There is no need to check to see if j overflowed in this loop as we're only
incrementing i.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17944 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 05:28:21 +00:00
Chris Lattner
1e409bfd2a Moderate head scratching reveals that this conditional is not needed. If
i->start == j->start, then certainly i->end > j->start.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17943 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 05:19:02 +00:00
Chris Lattner
f348e3abfc Fix a couple of bugs where we considered physregs past their range as possibly
intersecting an interval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17939 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 04:33:31 +00:00
Chris Lattner
1a3a487763 Fix typeo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17938 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 04:31:10 +00:00
Chris Lattner
365b95fbbc Start using the iterators in the fixed_ intervals to avoid having to binary
search physreg intervals every time we access it.  This takes another
half second off of linscan.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17937 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 04:13:02 +00:00
Chris Lattner
8c68b6a226 Take another .7 seconds off of linear scan time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17936 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 04:02:11 +00:00
Chris Lattner
19828d46f6 Add a counter for the number of times linscan has to backtrack. Start using
the iterator hints we have to speed up overlaps().  This speeds linscan up
by about .2s (out of 8.7) on 175.vpr for PPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17935 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 03:49:30 +00:00
Chris Lattner
bae74d9192 Add ability to give hints to the overlaps routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17934 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 03:47:34 +00:00
Chris Lattner
cbb5625cec * Improve comments/documentation substantially
* Eliminate the releaseMemory method, this is not an analysis
* Change the fixed, active, and inactive lists of intervals to maintain an
  iterator for the current position in the interval.  This allows us to do
  constant time increments of the iterator instead of having to do a binary
  search to find our liverange in our liveinterval all of the time, which
  substantially speeds up cases where LiveIntervals have many LiveRanges
  - which is very common for physical registers.  On targets with many
  physregs, this can make a noticable difference.

  With a release build of LLC for PPC, this halves the time in
  processInactiveIntervals and processActiveIntervals, from 1.5s to .75s.

  This also lays the ground for more to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17933 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 02:42:27 +00:00
Chris Lattner
743ef6d70e Add new advanceTo method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17932 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 02:37:31 +00:00
Chris Lattner
8d8d513d4d Fix a minor bug in expiredAt. endNumber() is the first number that is not valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17931 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 01:34:44 +00:00
Chris Lattner
23b71c1e1e Rename some methods, use 'begin' instead of 'start', add new LiveInterval
iterator/begin/end members.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17930 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-18 01:29:39 +00:00
Brian Gaeke
8311befb69 Give a better message for a common assertion failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17887 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-16 06:52:35 +00:00
Chris Lattner
41ffe4b531 Do not make i have bigger scope that we need
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17483 91177308-0d34-0410-b5e6-96231b3b80d8
2004-11-05 04:47:37 +00:00
Reid Spencer
6cb21d443e Change Library Names Not To Conflict With Others When Installed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-27 23:18:45 +00:00
Chris Lattner
52c09d7656 Move method bodies that depend on <algorithm> from MBB.h to MBB.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17253 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26 15:43:42 +00:00
Chris Lattner
27f291600b Clean up the MachineBasicBlock.h file, percolating #includes into this file.
Patch contributed by Morten Ofstad


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17251 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26 15:35:58 +00:00
Chris Lattner
ad3c74fc9b Reduce usage of MRegisterInfo::getRegClass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17238 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-26 05:29:18 +00:00
Chris Lattner
6fcd8d848d Do not use variable sized arrays in C++, they are non-portable. Patch
contributed by Morten Ofstad


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17217 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-25 18:44:14 +00:00
Chris Lattner
7a36ae8b01 Patch to support MSVC better, contributed by Morten Ofstad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17215 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-25 18:40:47 +00:00
Reid Spencer
cac731ecbe We won't use automake
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17155 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-22 03:35:04 +00:00
Reid Spencer
86d341b204 Initial automake generated Makefile template
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17136 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-18 23:55:41 +00:00
Chris Lattner
bd1d382cc4 Add support for undef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17055 91177308-0d34-0410-b5e6-96231b3b80d8
2004-10-16 18:19:26 +00:00