David Greene
9fab20f5d2
Change errs() to dbgs().
...
llvm-svn: 92596
2010-01-05 01:26:09 +00:00
Bill Wendling
747a2ba2a1
Revert accidental commit.
...
llvm-svn: 91635
2009-12-17 23:45:18 +00:00
Bill Wendling
2911fdb37b
Turn off critical edge splitting for landing pads. The introduction of a
...
non-landing pad basic block as the successor to a block that ends in an
unconditional jump will cause block folding to remove the added block as a
successor. Thus eventually removing it AND the landing pad entirely. Critical
edge splitting is an optimization, so we can safely turn it off when dealing
with landing pads.
llvm-svn: 91634
2009-12-17 23:42:32 +00:00
Lang Hames
deed780bc6
The Indexes Patch.
...
This introduces a new pass, SlotIndexes, which is responsible for numbering
instructions for register allocation (and other clients). SlotIndexes numbering
is designed to match the existing scheme, so this patch should not cause any
changes in the generated code.
For consistency, and to avoid naming confusion, LiveIndex has been renamed
SlotIndex.
The processImplicitDefs method of the LiveIntervals analysis has been moved
into its own pass so that it can be run prior to SlotIndexes. This was
necessary to match the existing numbering scheme.
llvm-svn: 85979
2009-11-03 23:52:08 +00:00
Nick Lewycky
2b8400628d
Remove includes of Support/Compiler.h that are no longer needed after the
...
VISIBILITY_HIDDEN removal.
llvm-svn: 85043
2009-10-25 06:57:41 +00:00
Nick Lewycky
711c726c97
Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
...
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.
llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Lang Hames
40530eacdb
Oops. Renamed remaining MachineInstrIndex references.
...
llvm-svn: 83255
2009-10-03 04:31:31 +00:00
Lang Hames
f6903a7043
Renamed MachineInstrIndex to LiveIndex.
...
llvm-svn: 83254
2009-10-03 04:21:37 +00:00
Lang Hames
94043b797a
Removed static qualifier from a few index related methods. These methods may require a LiveIntervals instance in future.
...
llvm-svn: 81374
2009-09-09 20:14:17 +00:00
Lang Hames
e504e61ab5
Replaces uses of unsigned for indexes in LiveInterval and VNInfo with
...
a new class, MachineInstrIndex, which hides arithmetic details from
most clients. This is a step towards allowing the register allocator
to update/insert code during allocation.
llvm-svn: 81040
2009-09-04 20:41:11 +00:00
Chris Lattner
89d3d59e83
remove a few DOUTs here and there.
...
llvm-svn: 79832
2009-08-23 06:35:02 +00:00
Lang Hames
1503988bb5
Modified VNInfo. The "copy" member is now a union which holds the copy for a register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg.
...
llvm-svn: 78620
2009-08-10 23:43:28 +00:00
Dan Gohman
4529d71681
Use setPreservesAll and setPreservesCFG in CodeGen passes.
...
llvm-svn: 77754
2009-07-31 23:37:33 +00:00
Lang Hames
ceb80b14d3
Improved tracking of value number kills. VN kills are now represented
...
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.
A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test
condition has been updated to reflect this.
llvm-svn: 75097
2009-07-09 03:57:02 +00:00
Lang Hames
5c64015a56
VNInfo cleanup.
...
llvm-svn: 73634
2009-06-17 21:01:20 +00:00
Lang Hames
1a81422fab
Update to in-place spilling framework. Includes live interval scaling and trivial rewriter.
...
llvm-svn: 72729
2009-06-02 16:53:25 +00:00
Owen Anderson
dbb4904467
Fix a bug in live-in detection that caused lost-copy problems to show up.
...
llvm-svn: 57424
2008-10-12 20:39:30 +00:00
Argyrios Kyrtzidis
b9e76c172c
Fix compilation error on MSVC.
...
llvm-svn: 57046
2008-10-04 08:11:49 +00:00
Dan Gohman
30c5ce1b7d
Switch the MachineOperand accessors back to the short names like
...
isReg, etc., from isRegister, etc.
llvm-svn: 57006
2008-10-03 15:45:36 +00:00
Owen Anderson
1c171e1d1c
Use a multimap rather than a map for holding the list of copies to insert, so we don't lose copies when two of them have
...
the same source. I don't know what I was thinking when I wrote this originally.
Note: There's probably a more efficient way to do this, but I need to think about it some more, and about what determinism
guarantees need to be present.
llvm-svn: 56964
2008-10-02 19:40:33 +00:00
Owen Anderson
9c1e298f14
Mark merged-in VNInfo's as being PHIKilled.
...
llvm-svn: 56893
2008-09-30 23:58:47 +00:00
Owen Anderson
70a6539add
We don't need to insert copies for implicit_def's.
...
llvm-svn: 56674
2008-09-26 18:50:46 +00:00
Owen Anderson
2cfce89777
Fix off-by-one error when updating live intervals.
...
llvm-svn: 56567
2008-09-24 21:30:38 +00:00
Owen Anderson
5405b59bcd
Add initial support for inserting last minute copies.
...
llvm-svn: 56485
2008-09-23 04:37:10 +00:00
Owen Anderson
67df9bc5b8
Significant improvements to the logic for merging live intervals. This code can't
...
just use LI::MergeValueAsValue, as its behavior in the presence of overlapping ranges
isn't what StrongPHIElimination wants.
llvm-svn: 56472
2008-09-22 21:58:58 +00:00
Dan Gohman
e1f9be27bc
Tidy up several unbeseeming casts from pointer to intptr_t.
...
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Dan Gohman
027326ba3e
Use empty() instead of begin() == end().
...
llvm-svn: 54780
2008-08-14 18:13:49 +00:00
Owen Anderson
9007c9afde
Get rid of unused variable.
...
llvm-svn: 54742
2008-08-13 17:44:52 +00:00
Owen Anderson
95ac2ab349
1) Merge entire live intervals instead of parts of them.
...
2) Conditionalize temporary insertion if we don't need it.
llvm-svn: 54741
2008-08-13 17:25:42 +00:00
Owen Anderson
1893d0f813
Do a dominator walk when scheduling copies, rather than a DFS on the CFG. Also, fix a few problems when creating
...
live intervals for temporaries created by phi elimination.
llvm-svn: 54483
2008-08-07 18:28:07 +00:00
Owen Anderson
655eb1a3bc
Correct handle cases where two phis are coalesced together, and correct break up the case where two different
...
phis want to coalesce with the same vreg.
llvm-svn: 54426
2008-08-06 22:08:58 +00:00
Owen Anderson
5929d57f67
We don't need to try to coalesce input vregs that are the same as the output vreg.
...
llvm-svn: 54422
2008-08-06 20:29:20 +00:00
Owen Anderson
482d679301
Only trim a live interval if the register is not used after the PHI node.
...
llvm-svn: 54421
2008-08-06 18:36:17 +00:00
Owen Anderson
11731063b9
Oops, we were already checking for dead phis. Handle this the proper way, then.
...
llvm-svn: 54371
2008-08-05 21:18:51 +00:00
Owen Anderson
dacdf44612
We don't need to update live intervals for dead PHIs.
...
llvm-svn: 54369
2008-08-05 20:51:26 +00:00
Owen Anderson
4e5db8d80f
Use existing LiveInterval methods to simplify live interval merging. Thanks to Evan for pointing these out.
...
llvm-svn: 54225
2008-07-30 18:27:35 +00:00
Owen Anderson
6147af0f8c
When merging live intervals, we also need to merge in any live ranges that are inputs to two-address instructions
...
that themselves define a range we already care about.
llvm-svn: 54185
2008-07-30 00:21:16 +00:00
Owen Anderson
ab575176fc
When merging a PHI operand's live interval into the PHI's live interval, we need to merge over all liveranges in
...
the operand's interval that share the relevant value number, not just the range that immediately precedes the PHI.
llvm-svn: 54174
2008-07-29 21:17:08 +00:00
Owen Anderson
25a3bf3f0e
Fix the issues originally addressed in r54070. After thinking about it some more, I realized that the right thing to do
...
is to have StrongPHIElimination use its knowledge of the PHIs before they're erased to update the intervals appropriate. This is
both simpler and more accurate than the alternative, which was having LIA figure it out when it renumbered things, plus it's just
the right thing to do!
llvm-svn: 54077
2008-07-25 23:38:08 +00:00
Owen Anderson
9e3ea5a60c
In order to avoid reprocessing a register more than once, we need to add it
...
to the handled set so it will get filtered out in future iterations.
llvm-svn: 54065
2008-07-25 21:35:43 +00:00
Owen Anderson
987bd1dc5b
Remove live interval entries for an interval if we're eliminating its only VN.
...
llvm-svn: 54062
2008-07-25 21:08:41 +00:00
Owen Anderson
cb7fb7aa4a
Store the predecessor MBB in the PHIUnion, rather than an index, since the indices will change after renumbering.
...
llvm-svn: 53985
2008-07-24 17:12:16 +00:00
Owen Anderson
6b49b2db48
Remove debugging code.
...
llvm-svn: 52016
2008-06-05 18:43:34 +00:00
Owen Anderson
18ca5de680
Use the newly created helper on LiveIntervals.
...
llvm-svn: 52013
2008-06-05 17:22:53 +00:00
Owen Anderson
503cf18547
Correctly construct live intervals for the copies we inserted into the predecessors of a block containing a PHI.
...
llvm-svn: 51950
2008-06-04 17:55:58 +00:00
Owen Anderson
f9c76de0bb
We need to subtract one from this index because live ranges are open at the end.
...
llvm-svn: 51922
2008-06-04 00:38:56 +00:00
Owen Anderson
9ba2e2794e
Preserve the register coallescer, and update live intervals more correctly by triggering a renumbering after phi elimination.
...
llvm-svn: 51780
2008-05-30 18:38:26 +00:00
Dan Gohman
138a53b303
Change class' public PassInfo variables to by initialized with the
...
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.
Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.
llvm-svn: 51022
2008-05-13 02:05:11 +00:00
Dan Gohman
bab18cae46
Clean up the use of static and anonymous namespaces. This turned up
...
several things that were neither in an anonymous namespace nor static
but not intended to be global.
llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Owen Anderson
e2690ed8b6
In some situations, we need to check for local interferences between the PHI
...
node and its inputs.
llvm-svn: 49070
2008-04-02 03:00:13 +00:00