Chris Lattner
c487970d6b
Whoops, don't try to lower non intrinsic calls
...
llvm-svn: 10632
2003-12-28 09:53:23 +00:00
Chris Lattner
66fb20d2d3
Use the intrinsic lowering functionality
...
llvm-svn: 10626
2003-12-28 09:43:35 +00:00
Chris Lattner
068ac4236d
Move into the VMCore library
...
llvm-svn: 10623
2003-12-28 08:30:20 +00:00
Chris Lattner
57ff7c242c
Implement the default implementation of the intrinsic lowering class
...
llvm-svn: 10621
2003-12-28 08:19:41 +00:00
Chris Lattner
a8c942c188
finegrainify namespacification
...
minor cleanups
llvm-svn: 10619
2003-12-28 07:59:53 +00:00
Alkis Evlogimenos
597e2f3501
Improve debugging output when choosing a register to spill.
...
llvm-svn: 10604
2003-12-24 18:53:31 +00:00
Alkis Evlogimenos
2c947a4fa0
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).
llvm-svn: 10603
2003-12-24 15:44:53 +00:00
Alkis Evlogimenos
ca57dd1089
Change the way free regusters are computed and perform better
...
allocation in the presence of preallocated intervals.
llvm-svn: 10595
2003-12-23 18:00:33 +00:00
Alkis Evlogimenos
10de430568
Fix crash when compiling twolf.
...
llvm-svn: 10584
2003-12-22 13:54:29 +00:00
Alkis Evlogimenos
7062ccbc85
Remove verifyIntervals() since it doesn't actually work right now.
...
llvm-svn: 10570
2003-12-21 20:41:26 +00:00
Alkis Evlogimenos
4401d0a7a3
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 );
llvm-svn: 10569
2003-12-21 20:19:10 +00:00
Alkis Evlogimenos
4f98b79ef0
Add support for inactive intervals. This effectively reuses registers
...
for live ranges that fall into assigned registers' holes.
llvm-svn: 10566
2003-12-21 05:43:40 +00:00
Chris Lattner
461a62626a
Add a new target-independent machine code freeing pass
...
llvm-svn: 10560
2003-12-20 10:20:58 +00:00
Chris Lattner
d476049d19
* 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.
llvm-svn: 10553
2003-12-20 09:17:07 +00:00
Alkis Evlogimenos
9181e0ab5b
Remove TwoAddressInstruction from the public headers and add an ID
...
instead, since this pass doesn't expose any state to its users.
llvm-svn: 10520
2003-12-18 22:40:24 +00:00
Chris Lattner
c984af2771
Prune some #includes
...
Add a statistic for # reloads
llvm-svn: 10518
2003-12-18 20:25:31 +00:00
Alkis Evlogimenos
f6e9dd4942
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.
llvm-svn: 10515
2003-12-18 13:15:02 +00:00
Alkis Evlogimenos
9bb0ad1a37
Fix bug in reserved registers. DH actually aliases DX and EDX which
...
are not reserved registers.
llvm-svn: 10514
2003-12-18 13:12:18 +00:00
Alkis Evlogimenos
48d20cb328
Modify local register allocator to use the two-address instruction pass.
...
llvm-svn: 10513
2003-12-18 13:08:52 +00:00
Alkis Evlogimenos
90aeecae42
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.
llvm-svn: 10512
2003-12-18 13:06:04 +00:00
Alkis Evlogimenos
befef566f6
Rename LiveIntervals::expired() to LiveIntervals::expiredAt().
...
llvm-svn: 10511
2003-12-18 08:56:11 +00:00
Alkis Evlogimenos
382bfbffeb
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.
llvm-svn: 10510
2003-12-18 08:53:43 +00:00
Alkis Evlogimenos
8e2fcc7d79
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.
llvm-svn: 10509
2003-12-18 08:48:48 +00:00
Alkis Evlogimenos
657eb40294
Change preserve all claim to just preserve live variables and phielimination.
...
llvm-svn: 10469
2003-12-15 04:55:38 +00:00
Alkis Evlogimenos
29127b8825
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.
llvm-svn: 10461
2003-12-14 13:24:17 +00:00
Alkis Evlogimenos
d58f58b351
When reserving a preallocated register spill the aliases of this
...
register too.
llvm-svn: 10450
2003-12-13 11:58:10 +00:00
Alkis Evlogimenos
f84f86137b
Ignore non-allocatable physical registers in live interval analysis.
...
llvm-svn: 10449
2003-12-13 11:11:02 +00:00
Alkis Evlogimenos
18bf6b5ad7
Expire any active intervals left when register allocation is done.
...
llvm-svn: 10448
2003-12-13 05:50:19 +00:00
Alkis Evlogimenos
225fc9c6db
Add instruction numbers to debugging output.
...
llvm-svn: 10447
2003-12-13 05:48:57 +00:00
Alkis Evlogimenos
2a41fcbef3
Handle explicit physical register defs.
...
llvm-svn: 10445
2003-12-13 05:26:39 +00:00
Alkis Evlogimenos
6e511754e5
Remove unecessary if statements when looping on ImplicitDefs.
...
llvm-svn: 10444
2003-12-13 01:20:58 +00:00
John Criswell
ea48d9cd13
This appears to fix Bug 172 and does not break any other feature tests or
...
regression tests.
llvm-svn: 10388
2003-12-10 22:51:41 +00:00
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