Commit Graph

752 Commits

Author SHA1 Message Date
Alkis Evlogimenos
f3373f7bc9 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).

llvm-svn: 10292
2003-12-05 11:31:39 +00:00
Alkis Evlogimenos
711ebbdd57 Fix bug in register spilling when a preallocated live range overlaps a
potential register assignment.

llvm-svn: 10291
2003-12-05 11:17:55 +00:00
Alkis Evlogimenos
229c2b9181 Move operator<<(std::ostream&, const LiveInterval&) out of the header file.
llvm-svn: 10290
2003-12-05 10:38:28 +00:00
Alkis Evlogimenos
52ec591c66 Sort live intervals by increasing start point.
llvm-svn: 10289
2003-12-05 10:32:01 +00:00
Alkis Evlogimenos
6f8151e202 Improve debugging output and clean up some code.
llvm-svn: 10288
2003-12-04 03:57:28 +00:00
Alkis Evlogimenos
c1409f46b6 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.

llvm-svn: 10272
2003-11-30 23:40:39 +00:00
Alkis Evlogimenos
36630268ae Remove "numReloaded" statistic.
llvm-svn: 10268
2003-11-30 05:15:36 +00:00
Alkis Evlogimenos
6627a32ff9 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.
llvm-svn: 10103
2003-11-20 03:32:25 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Brian Gaeke
612254327c Fix problems linking against the reoptimizer; _llvm_regAllocState must have
externally-visible linkage, and SaveStateToModule must default to true for llc.
I don't remember why I made it const; perhaps it should be deconstified.

llvm-svn: 9858
2003-11-10 07:12:01 +00:00
Brian Gaeke
490bf81152 Operand numbers are now ints. Save the register allocation of the value
each instruction produces as "operand" -1, and the other operands as 0
.. n, as before. PhyRegAlloc::saveState() is refactored into
PhyRegAlloc::saveStateForValue().

llvm-svn: 9842
2003-11-10 00:05:26 +00:00
Misha Brukman
6667a74caf Let's not forget about our friends -- Constant Pool indices.
llvm-svn: 9750
2003-11-06 00:04:11 +00:00
Chris Lattner
1370c57a42 Do not use a class before it is defined.
Be gcc 3.4 clean

llvm-svn: 9727
2003-11-05 06:25:06 +00:00
Brian Gaeke
8dadbe31dc Update verifySavedState()'s comment, so that it reflects its current
status.  In doFinalization(), skip over external functions, just like
Anand's mapping info does.

llvm-svn: 9703
2003-11-04 22:42:41 +00:00
Brian Gaeke
f641ebe313 Add comments.
llvm-svn: 9697
2003-11-04 18:25:56 +00:00
Brian Gaeke
29d56dd004 Include llvm/CodeGen/MachineCodeForInstruction.h. Use it to start
implementing verifySavedState().

In saveState(), use the new AllocInfo::AllocStateTy enum, and increment
Insn each time through the loop.

llvm-svn: 9617
2003-10-30 21:21:33 +00:00
Brian Gaeke
e78feb1c40 Make AllocState an enum.
Move the stringifying method for that enum into class AllocInfo.

llvm-svn: 9616
2003-10-30 21:21:22 +00:00
Brian Gaeke
04e6824a3f Publicize the type of FnAllocState.
Prototype option to save state in a global instead of as a Constant in
 the Module. (Turned off, for now, with the on/off switch welded in the off
 position. You get the idea.)

llvm-svn: 9500
2003-10-24 21:21:58 +00:00
Chris Lattner
d09d070385 standardize command line option names
llvm-svn: 9496
2003-10-24 20:05:58 +00:00
Brian Gaeke
665123fb99 Move the implementations of ==, != on AllocInfos here, from UnpackTraceFunction.
llvm-svn: 9452
2003-10-23 20:39:18 +00:00
Brian Gaeke
6d9f7ff0df Move AllocInfo structure to a private AllocInfo.h header file.
Make FnAllocState contain vectors of AllocInfo, instead of LLVM Constants.
Give doFinalization a method comment, and let it do the work of converting
 AllocInfos to LLVM Constants.

llvm-svn: 9451
2003-10-23 20:32:55 +00:00
Brian Gaeke
98fbdd344e Make FnAllocState contain vectors of AllocInfo, instead of LLVM Constants.
llvm-svn: 9450
2003-10-23 20:32:02 +00:00
Brian Gaeke
ede0b08125 New file, containing AllocInfo structure.
llvm-svn: 9449
2003-10-23 20:31:51 +00:00
Misha Brukman
966d423f89 * Eliminate `using' directive
* Fix order of #includes
* Make code layout more consistent
* Eliminate extraneous whitespace and comment-lines

llvm-svn: 9433
2003-10-23 18:10:02 +00:00
Misha Brukman
97911fb3bb * Fix order of #include files
* Doxygen-ify method comments

llvm-svn: 9432
2003-10-23 18:06:27 +00:00
Misha Brukman
c1b01b50fb * Order #includes as per style guide
* Doxygen-ify comments
* Make code layout more consistent

llvm-svn: 9431
2003-10-23 18:03:50 +00:00
Misha Brukman
765938c377 * Use C++ style comments instead of C-style
* Make file description more readable
* Make code layout more consistent, include comment in assert so it's visible
  during execution if it hits

llvm-svn: 9430
2003-10-23 18:02:47 +00:00
Misha Brukman
2c119cec9b * Eliminate `using' directive
* Make code layout more consistent

llvm-svn: 9427
2003-10-23 17:43:17 +00:00
Misha Brukman
22e5a5848b Make code layout more consistent.
llvm-svn: 9426
2003-10-23 17:39:37 +00:00
Brian Gaeke
916b2522f9 Change the type of FnAllocState.
llvm-svn: 9388
2003-10-22 20:44:29 +00:00
Brian Gaeke
5952eddbfb Don't worry about converting each function's reg. alloc. state into One Big
Constant early on, because we can do it in doFinalization.

Tighten up a comment.

llvm-svn: 9387
2003-10-22 20:44:23 +00:00
Brian Gaeke
4e1aade603 Add prototype for verifySavedState().
llvm-svn: 9386
2003-10-22 20:23:13 +00:00
Brian Gaeke
08fc8bcce4 Doxygenify method comments.
Try to improve method comments a little.
Get rid of some excess whitespace; put braces on previous line when possible.
Add stub for method to verify the work of saveState().

llvm-svn: 9385
2003-10-22 20:22:53 +00:00
John Criswell
4746befea3 Added LLVM copyright notice.
llvm-svn: 9324
2003-10-21 15:29:18 +00:00
John Criswell
de34542f41 Added LLVM copyright header.
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell
71d2894956 Added LLVM copyright notice to Makefiles.
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
87843f87b8 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
llvm-svn: 9269
2003-10-19 21:34:28 +00:00
Chris Lattner
eab4a2d0d1 #include vector which we will need here soon
llvm-svn: 9144
2003-10-15 22:09:32 +00:00
Chris Lattner
f2ed60c0b7 Decrease usage of use_size()
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Chris Lattner
b6c8569f05 Regularize header file comments
llvm-svn: 9071
2003-10-13 03:32:08 +00:00
Misha Brukman
9fcbd8d16f * Doxygenified comments
* Wrap code at 80 columns
* Ordered includes according to LLVM style guide

llvm-svn: 9020
2003-10-10 17:41:32 +00:00
Alkis Evlogimenos
74568bc9d4 Change MRegisterDesc::AliasSet, TargetInstrDescriptor::ImplicitDefs
and TargetInstrDescriptor::ImplicitUses to always point to a null
terminated array and never be null. So there is no need to check for
pointer validity when iterating over those sets. Code that looked
like:

if (const unsigned* AS = TID.ImplicitDefs) {
  for (int i = 0; AS[i]; ++i) {
    // use AS[i]
  }
}

was changed to:

for (const unsigned* AS = TID.ImplicitDefs; *AS; ++AS) {
  // use *AS
}

llvm-svn: 8960
2003-10-08 05:20:08 +00:00
Alkis Evlogimenos
a37b58ce09 Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.
llvm-svn: 8819
2003-10-02 16:57:49 +00:00
Chris Lattner
b0860d88c2 include passes.h which defines the interface this file exposes
llvm-svn: 8793
2003-09-30 20:13:59 +00:00
Brian Gaeke
8b15e271a5 Update head-of-file comment.
llvm-svn: 8699
2003-09-24 18:16:23 +00:00
Brian Gaeke
1c9978c999 Untabify tabs in stuff I've recently added.
Check in my register allocator state-saving code.

llvm-svn: 8698
2003-09-24 18:08:54 +00:00
Brian Gaeke
dee6b30348 Use getRegClassID() instead of getRegClass()->getID(), since it's there.
Shorten the markSuggestedColorUsable method.
Add a switch for saving reg. alloc. state (coming soon).

llvm-svn: 8697
2003-09-24 17:50:28 +00:00
Brian Gaeke
9ef4c789e3 Remove some unused methods of class IGNode.
llvm-svn: 8696
2003-09-24 04:29:52 +00:00
Chris Lattner
afea820122 Move getAnalysisUsage method from header to .cpp file. Add a normal file
header comment

llvm-svn: 8679
2003-09-23 15:13:04 +00:00