Commit Graph

527 Commits

Author SHA1 Message Date
Chris Lattner
bfddc2030a Add support for alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15888 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 19:14:29 +00:00
Misha Brukman
274ba03f49 Ultra-doxygenify some function header comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15884 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 17:52:36 +00:00
Chris Lattner
75585268a7 Allow targets to specify a comment character
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15879 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 16:26:36 +00:00
Chris Lattner
800ade1e19 Add missing \t
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15871 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 06:48:34 +00:00
Chris Lattner
46d6126e66 Add some hooks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15867 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 06:36:27 +00:00
Chris Lattner
af2bf0ab30 We now allow targets to use any prefix they want for global symbols. Lets
hear it for ".".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15863 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 06:06:19 +00:00
Chris Lattner
f1cb795394 Some asmweriters want an _ prefix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15844 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-17 02:28:12 +00:00
Chris Lattner
a80ba71efe Initial implementation of the asmprinter base class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15838 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 23:15:22 +00:00
Chris Lattner
2fcd451a5e Fit into 80 lines, add a gross hack for MachineFunctionInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15832 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 22:35:26 +00:00
Chris Lattner
5a6074053d These files now live in lib/Target/SparcV9
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15831 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-16 21:56:15 +00:00
Chris Lattner
913cbd65dc Remove helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15776 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-15 22:02:36 +00:00
Alkis Evlogimenos
706515727c Clean up whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15490 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 09:46:56 +00:00
Alkis Evlogimenos
1a8ea01f01 Convert indentation to 2 spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15489 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 09:46:26 +00:00
Brian Gaeke
826b19b4ec These headers have been moved/merged into other files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15477 91177308-0d34-0410-b5e6-96231b3b80d8
2004-08-04 07:37:56 +00:00
Chris Lattner
36c29dbbee New pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15367 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-31 09:59:14 +00:00
Chris Lattner
f24d879520 Expose some helpful methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15366 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-31 09:59:04 +00:00
Chris Lattner
dc4a4922d3 Add some machine CFG related stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15352 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-31 01:59:11 +00:00
Chris Lattner
d3a205eab5 Make a method const, no functionality changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15193 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 06:23:01 +00:00
Alkis Evlogimenos
3f86193cd2 Remove implementation of operator= and make it private so that it is
not used accidentally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15172 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 18:55:15 +00:00
Alkis Evlogimenos
a1613db62f Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,
LiveInterval>. This saves some space and removes the pointer
indirection caused by following the pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15167 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 11:44:15 +00:00
Chris Lattner
4df98e546d Completely eliminate the intervals_ list. instead, the r2iMap_ maintains
ownership of the intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15155 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 03:32:06 +00:00
Chris Lattner
0f4c076140 Add a new differingRegisterClasses method
make overlapsAliases take pointers instead of references
fix indentation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15153 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 02:53:43 +00:00
Chris Lattner
abf295fc6c Little stuff:
* Fix comment typeo
* add dump() methods
* add a few new methods like getLiveRangeContaining, removeRange & joinable
  (which is currently the same as overlaps)
* Remove the unused operator==

Bigger change:

* In LiveInterval, instead of using a boolean isDefinedOnce to keep track of
  if there are > 1 definitions in a particular interval, keep a counter,
  NumValues to keep track of exactly how many there are.
* In LiveRange, add a new ValId element to indicate which of the numbered
  values each LiveRange belongs to.   We now no longer merge LiveRanges if
  they are of differing value ID's even if they are neighbors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15152 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 02:52:23 +00:00
Chris Lattner
f35fef7060 More minor changes:
* Inline some functions
 * Eliminate some comparisons from the release build

This is good for another .3 on gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15144 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 21:24:19 +00:00
Chris Lattner
b26c215c05 Change addRange and join to be a little bit smarter. In particular, we don't
want to insert a new range into the middle of the vector, then delete ranges
one at a time next to the inserted one as they are merged.

Instead, if the inserted interval overlaps, just start merging.  The only time
we insert into the middle of the vector is when we don't overlap at all.  Also
delete blocks of live ranges if we overlap with many of them.

This patch speeds up joining by .7 seconds on a large testcase, but more
importantly gets all of the range adding code into addRangeFrom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15141 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 19:38:44 +00:00
Chris Lattner
e6ad392802 New helper method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15138 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 18:39:12 +00:00
Chris Lattner
4dc54ae0d9 Speedup debug builds a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 18:38:52 +00:00
Chris Lattner
ebd7e6c54d Instead of searching for a live interval pair, search for a location. This gives
a very modest speedup of .3 seconds compiling 176.gcc (out of 20s).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15136 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 18:13:24 +00:00
Chris Lattner
a3b8b5c0e0 Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15135 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 17:56:30 +00:00
Chris Lattner
fb449b9ea5 Pull the LiveRange and LiveInterval classes out of LiveIntervals.h (which
will soon be renamed) into their own file.  The new file should not emit
DEBUG output or have other side effects.  The LiveInterval class also now
doesn't know whether its working on registers or some other thing.

In the future we will want to use the LiveInterval class and friends to do
stack packing.  In addition to a code simplification, this will allow us to
do it more easily.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15134 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 17:49:16 +00:00
Chris Lattner
ec2bc64505 Improve comments a bit
Use an explicit LiveRange class to represent ranges instead of an std::pair.
This is a minor cleanup, but is really intended to make a future patch simpler
and less invasive.

Alkis, could you please take a look at LiveInterval::liveAt?  I suspect that
you can add an operator<(unsigned) to LiveRange, allowing us to speed up the
upper_bound call by quite a bit (this would also apply to other callers of
upper/lower_bound).  I would do it myself, but I still don't understand that
crazy liveAt function, despite the comment. :)

Basically I would like to see this:
    LiveRange dummy(index, index+1);
    Ranges::const_iterator r = std::upper_bound(ranges.begin(),
                                                ranges.end(),
                                                dummy);

Turn into:
    Ranges::const_iterator r = std::upper_bound(ranges.begin(),
                                                ranges.end(),
                                                index);


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15130 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 08:24:23 +00:00
Chris Lattner
fe1630b43e Force coallescing of live ranges that have a single definition, even if they
interfere.  Because these intervals have a single definition, and one of them
is a copy instruction, they are always safe to merge even if their lifetimes
interfere.  This slightly reduces the amount of spill code, for example on
252.eon, from:

 12837 spiller               - Number of loads added
  7604 spiller               - Number of stores added
  5842 spiller               - Number of register spills
 18155 liveintervals         - Number of identity moves eliminated after coalescing

to:

  12754 spiller               - Number of loads added
   7585 spiller               - Number of stores added
   5803 spiller               - Number of register spills
  18262 liveintervals         - Number of identity moves eliminated after coalescing

The much much bigger win would be to merge intervals with multiple definitions
(aka phi nodes) but this is not that day.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15124 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-23 05:26:05 +00:00
Alkis Evlogimenos
910d0d6066 Add Iterative scan register allocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15068 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-21 08:24:35 +00:00
Chris Lattner
1c5c0444f1 Split joinIntervals into two methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15003 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 14:08:10 +00:00
Chris Lattner
c49c872a1a Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15002 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 13:28:39 +00:00
Chris Lattner
81e26ce1da Delete 4 methods, make clients use hte mark* methods directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14999 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 07:52:25 +00:00
Chris Lattner
74de8b1b26 There is no need to store the MBB along with the MI any more, we can now
ask instructions for their parent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14998 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 07:04:55 +00:00
Chris Lattner
472405e0dc Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14997 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 06:55:21 +00:00
Chris Lattner
73d4adfb1e Remove the DefBlock element of VarInfo. DefBlock is always DefInst->getParent()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14996 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 06:26:50 +00:00
Chris Lattner
6b92906010 fill comment to 80 cols
remove map that is not needed


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14988 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-19 02:13:59 +00:00
Alkis Evlogimenos
71bf404e9b Add viewCFG() and viewCFGOnly() APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14679 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-08 00:47:58 +00:00
Chris Lattner
8b708e4752 Add a new pass for code generators to use
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14562 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-02 05:44:13 +00:00
Chris Lattner
61e4cb3605 Now that we have happy mappings from MBBs->numbers, use them instead of keeping
a LV private map


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14522 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 06:14:57 +00:00
Chris Lattner
25d8039bd6 Change the implementation of the autonumbering for MBB's a bit to provide
the reverse mapping as well as the mapping from MBB->unsigned


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14519 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-01 06:01:36 +00:00
Chris Lattner
ea104df2b1 This class is no longer an annotation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14437 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-27 18:50:49 +00:00
Chris Lattner
4aa5b2affb Add a map of MachineCodeForInstruction objects to MachineFunctionInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14436 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-27 18:50:30 +00:00
Chris Lattner
159286d60d Make it obvious that this file is bad bad bad
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14432 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-27 18:21:20 +00:00
Tanya Lattner
b140762a45 Made a fix so that you can print out MachineInstrs that belong to a MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14389 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-25 00:13:11 +00:00
Chris Lattner
418da55c89 Rename Interval class to LiveInterval to avoid conflicting with the already
existing llvm::Interval class.

Patch contributed by Vladimir Prus!
http://mail.cs.uiuc.edu/pipermail/llvmbugs/2004-June/000710.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14281 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-21 13:10:56 +00:00
Chris Lattner
90a62c8d4b Start moving IntrinsicLowering out of VMCore into libcodegen, as per PR346
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14264 91177308-0d34-0410-b5e6-96231b3b80d8
2004-06-20 07:40:46 +00:00