Commit Graph

812 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
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
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
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
Alkis Evlogimenos
b08bdc4a16 Make LiveVariables::HandlePhysRegUse and
LiveVariables::HandlePhysRegDef private they use information that is
not in memory when LiveVariables finishes the analysis.

Also update the TwoAddressInstructionPass to not use this interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10755 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-11 09:18:45 +00:00
Chris Lattner
ae7fc3aede Remove use of llvm/CodeGen/InstrSelection.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10749 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-10 19:16:26 +00:00
Chris Lattner
d5da197071 Finegrainify namespacification.
This should get hunked over to the Sparc backend, along with
MachineCodeForInstruction and a bunch of files in include/llvm/Codegen,
but those battles will have to wait for a later time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10731 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:30:18 +00:00
Chris Lattner
2abcf524a1 Move InstrSelection into lib/Target/Sparc, as it's sparc specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10730 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:24:06 +00:00
Chris Lattner
75e260990d Move lib/Codegen/RegAlloc into lib/Target/Sparc, as it is sparc specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10728 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-09 06:17:12 +00:00
Alkis Evlogimenos
7d629b50a5 Add a separate list of fixed intervals. This improves the running time
of the register allocator as follows:

       before   after
mesa   2.3790  1.5994
vpr    2.6008  1.2078
gcc    1.9840  0.5273
mcf    0.2569  0.0470
eon    1.8468  1.4359
twolf  0.9475  0.2004
burg   1.6807  1.3300
lambda 1.2191  0.3764

Speedups range anyware from 30% to over 400% :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10712 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-07 09:20:58 +00:00
Alkis Evlogimenos
1283d86b63 Minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10711 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-07 05:31:12 +00:00
Alkis Evlogimenos
75ca6a3e82 Remove declared but undefined method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10710 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-07 02:29:33 +00:00
Alkis Evlogimenos
80b378cf7c Change implementation of LiveIntervals::overlap(). This results in a
30-50% decrease in running time of the linear scan register allocator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10707 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-07 01:45:58 +00:00
Alkis Evlogimenos
63caedf046 Remove simple coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10695 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 08:24:57 +00:00
Chris Lattner
8c2403631b fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10692 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 05:42:17 +00:00
Chris Lattner
77b1330ece Add VMCore and code generator support for debugging intrinsics. By default
code generators completely ignore them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10691 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 05:36:30 +00:00
Alkis Evlogimenos
271bd2d7f1 Currently we cannot handle two-address instructions of the form:
A = B op C where A == C, but this cannot really occur in practice
because of SSA form. Add an assert to check that just to be safe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10682 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-05 02:25:45 +00:00
Alkis Evlogimenos
50c047d159 Update description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10681 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-04 23:09:24 +00:00
Chris Lattner
f70e0c216c Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10636 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 21:23:38 +00:00
Alkis Evlogimenos
27490a6fcc Reserve ECX and EDI instead of EBX and EDI. Since EBX is a callee
saved register it has a longer free range than ECX (which is defined
every time there is a fnuction call) which makes ECX a better register
to reserve.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10635 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 18:03:52 +00:00
Alkis Evlogimenos
26bfc08b80 Add coalescing to register allocator. A hint is added to each interval
which denotes the register we would like to be assigned to (virtual or
physical). In register allocation, if this hint exists and we can map
it to a physical register (it is either a physical register or it is a
virtual register that already got assigned to a physical one) we use
that register if it is available instead of a random one in the free
pool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10634 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 17:58:18 +00:00
Chris Lattner
aed386e6b0 Whoops, don't try to lower non intrinsic calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10632 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:53:23 +00:00
Chris Lattner
f8742b3e03 Use the intrinsic lowering functionality
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10626 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 09:43:35 +00:00
Chris Lattner
42450d8a5f Move into the VMCore library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10623 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 08:30:20 +00:00
Chris Lattner
3b66ecb05f Implement the default implementation of the intrinsic lowering class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10621 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 08:19:41 +00:00
Chris Lattner
aa4c91ff96 finegrainify namespacification
minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10619 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-28 07:59:53 +00:00
Alkis Evlogimenos
843397c237 Improve debugging output when choosing a register to spill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10604 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-24 18:53:31 +00:00
Alkis Evlogimenos
7a40eaacee 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10603 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-24 15:44:53 +00:00
Alkis Evlogimenos
3bf564a95f Change the way free regusters are computed and perform better
allocation in the presence of preallocated intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10595 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-23 18:00:33 +00:00
Alkis Evlogimenos
056063e264 Fix crash when compiling twolf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10584 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-22 13:54:29 +00:00
Alkis Evlogimenos
4de1fefd7c Remove verifyIntervals() since it doesn't actually work right now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10570 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-21 20:41:26 +00:00
Alkis Evlogimenos
6b4edbaaf9 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 );


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10569 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-21 20:19:10 +00:00
Alkis Evlogimenos
169cfd0196 Add support for inactive intervals. This effectively reuses registers
for live ranges that fall into assigned registers' holes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10566 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-21 05:43:40 +00:00
Chris Lattner
16c45e9de8 Add a new target-independent machine code freeing pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10560 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 10:20:58 +00:00
Chris Lattner
07f32d48f1 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10553 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-20 09:17:07 +00:00
Alkis Evlogimenos
4c080863de Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10520 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 22:40:24 +00:00
Chris Lattner
5e46b513f3 Prune some #includes
Add a statistic for # reloads


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10518 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 20:25:31 +00:00
Alkis Evlogimenos
a71e05acdd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10515 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 13:15:02 +00:00
Alkis Evlogimenos
a3d0e5c2b2 Fix bug in reserved registers. DH actually aliases DX and EDX which
are not reserved registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10514 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 13:12:18 +00:00
Alkis Evlogimenos
9af9dbde7d Modify local register allocator to use the two-address instruction pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10513 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 13:08:52 +00:00
Alkis Evlogimenos
71499ded4d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10512 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 13:06:04 +00:00
Alkis Evlogimenos
485ec3c21e Rename LiveIntervals::expired() to LiveIntervals::expiredAt().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10511 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 08:56:11 +00:00
Alkis Evlogimenos
43f692f90f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10510 91177308-0d34-0410-b5e6-96231b3b80d8
2003-12-18 08:53:43 +00:00