1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

97 Commits

Author SHA1 Message Date
Benjamin Kramer
4b94ce229d Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
only a single type of object to be allocated. Use it to make VNInfo destruction
typesafe.

llvm-svn: 99919
2010-03-30 20:16:45 +00:00
Torok Edwin
df7c52143e Reapply r99881 with some fixes: only call destructor in releaseMemory!
llvm-svn: 99883
2010-03-30 11:17:48 +00:00
Jakob Stoklund Olesen
fe3fae23e4 Use methods to determine if a LiveInterval is spillable.
Don't accidentally produce unspillable intervals for deeply nested loops.

llvm-svn: 97496
2010-03-01 20:59:38 +00:00
Dan Gohman
efb42fa7c7 Fix several comments which had previously been "the the" where a
different word was intended.

llvm-svn: 95795
2010-02-10 20:04:19 +00:00
Dan Gohman
92b6122204 Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +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
Lang Hames
f6903a7043 Renamed MachineInstrIndex to LiveIndex.
llvm-svn: 83254
2009-10-03 04:21:37 +00:00
Evan Cheng
83bb285c97 Add early coalescing to liveintervals. This is work in progress and is known to miscompute some tests. Read it at your own rish, I have aged 10 year while writing this.
The gist of this is if source of some of the copies that feed into a phi join is defined by the phi join, we'd like to eliminate them. However, if any of the non-identity source overlaps the live interval of the phi join then the coalescer won't be able to coalesce them. The early coalescer's job is to eliminate the identity copies by partially-coalescing the two live intervals.

llvm-svn: 81796
2009-09-14 21:33:42 +00:00
Lang Hames
45a2936a06 Whoops. Committed the headers for r81605 - 'Moved some more index operations over to LiveIntervals.'
llvm-svn: 81609
2009-09-12 04:54:18 +00:00
Bob Wilson
013dfaa93a Stabilize the order of live intervals in the priority_queue used by the
linear scan reg alloc.  This fixes a problem I ran into where extracting
a function from a larger file caused the generated code to change (masking
the problem I was trying to debug) because the allocator behaved differently.

This changes the results for two X86 regression checks.  stack-color-with-reg
is improved, with one less instruction, but pr3495 is worse, with one more
copy.  As far as I can tell, these tests were just getting lucky or unlucky,
so I've changed the expected results.

llvm-svn: 81060
2009-09-05 01:19:16 +00:00
Lang Hames
82f4d9b9fc Removed yet another std::ostream reference.
llvm-svn: 81042
2009-09-04 21:03:07 +00:00
Lang Hames
011d0c0755 Removed some junk and a std::ostream operator that was hanging around.
llvm-svn: 81041
2009-09-04 20:54:51 +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
6512a3a281 shoot a few more std::ostream print methods in the head.
llvm-svn: 79814
2009-08-23 03:47:42 +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
Daniel Dunbar
339c88008f Move more to raw_ostream, provide support for writing MachineBasicBlock,
LiveInterval, etc to raw_ostream.

llvm-svn: 76965
2009-07-24 10:36:58 +00:00
David Greene
7f92a15a4b Make some changes suggested by Bill and Evan.
llvm-svn: 76775
2009-07-22 20:08:25 +00:00
Daniel Dunbar
2554dd4f1e Remove mismatched and unnecessary declaration.
llvm-svn: 75841
2009-07-15 21:52:40 +00:00
Lang Hames
7238ca2267 New VNInfo alignment patch by Ryan Flynn.
llvm-svn: 75609
2009-07-14 05:46:55 +00:00
Lang Hames
19644baf4c Unbroke LiveInterval.
llvm-svn: 75588
2009-07-14 02:17:17 +00:00
Lang Hames
2600777dac Tidy up VNInfo alignment code. Patch contributed by Ryan Flynn.
llvm-svn: 75587
2009-07-14 02:05:37 +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
1bade5ff09 More VNInfo tweaking, plus a little progress on intra-block splitting.
llvm-svn: 73750
2009-06-19 02:17:53 +00:00
Chris Lattner
47e29d1422 Don't use int8_t, that requires DataTypes.h
llvm-svn: 73682
2009-06-18 04:56:53 +00:00
Zhongxing Xu
8b992b2a97 include header for uint8_t.
llvm-svn: 73675
2009-06-18 04:11:43 +00:00
Lang Hames
5c64015a56 VNInfo cleanup.
llvm-svn: 73634
2009-06-17 21:01:20 +00:00
Evan Cheng
1607bd1fa9 Move register allocation preference (or hint) from LiveInterval to MachineRegisterInfo. This allows more passes to set them.
llvm-svn: 73346
2009-06-14 20:22:55 +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
Evan Cheng
696a04eba2 Do not share a single unknown val# for all the live ranges merged into a physical sub-register live interval. When coalescer is merging in clobbered virtaul register live interval into a physical register live interval, give each virtual register val# a separate val# in the physical register live interval. Otherwise, the coalescer would have lost track of the definitions information it needs to make correct coalescing decisions.
llvm-svn: 70026
2009-04-25 09:25:19 +00:00
Evan Cheng
1b6d7dc766 Add a new LiveInterval::overlaps(). It checks if the live interval overlaps a range specified by [Start, End).
llvm-svn: 69434
2009-04-18 08:52:15 +00:00
Dan Gohman
770f4158e5 Use CHAR_BIT instead of hard-coding 8 in several places where it
is appropriate. This helps visually differentiate host-oriented
calculations from target-oriented calculations.

llvm-svn: 68227
2009-04-01 18:45:54 +00:00
Evan Cheng
264173da40 Two coalescer fixes in one.
1. Use the same value# to represent unknown values being merged into sub-registers.
2. When coalescer commute an instruction and the destination is a physical register, update its sub-registers by merging in the extended ranges.

llvm-svn: 66610
2009-03-11 00:03:21 +00:00
Evan Cheng
b5792305b3 Strengthen the previous check.
llvm-svn: 64076
2009-02-08 08:24:28 +00:00
Evan Cheng
7d46312873 (no commit message)
llvm-svn: 64073
2009-02-08 07:48:37 +00:00
Owen Anderson
9d2293f7ad MergeValueInto is too smart: it might choose to do the merge the opposite direction.
Live interval reconstruction needs to account for this, and scour its maps to
prevent dangling references.

llvm-svn: 63558
2009-02-02 22:42:01 +00:00
Evan Cheng
1346d22223 Exit with nice warnings when register allocator run out of registers.
llvm-svn: 63267
2009-01-29 02:20:59 +00:00
Evan Cheng
da5915379c Fix comment about removeRange.
llvm-svn: 63255
2009-01-29 00:06:09 +00:00
Owen Anderson
4acaef9e5f Forgot to commit this file.
Add a clear() method to remove all ranges and value numbers for a live interval.

llvm-svn: 61459
2008-12-28 21:57:02 +00:00
Dan Gohman
6124fd2975 LiveInterval::removeKills and isKill don't need 'this' and
can be static member functions.

llvm-svn: 61278
2008-12-20 16:44:40 +00:00
Evan Cheng
da55c4ffb7 Fix PR3149. If an early clobber def is a physical register and it is tied to an input operand, it effectively extends the live range of the physical register. Currently we do not have a good way to represent this.
172     %ECX<def> = MOV32rr %reg1039<kill>
180     INLINEASM <es:subl $5,$1
        sbbl $3,$0>, 10, %EAX<def>, 14, %ECX<earlyclobber,def>, 9, %EAX<kill>,
36, <fi#0>, 1, %reg0, 0, 9, %ECX<kill>, 36, <fi#1>, 1, %reg0, 0
188     %EAX<def> = MOV32rr %EAX<kill>
196     %ECX<def> = MOV32rr %ECX<kill>
204     %ECX<def> = MOV32rr %ECX<kill>
212     %EAX<def> = MOV32rr %EAX<kill>
220     %EAX<def> = MOV32rr %EAX
228     %reg1039<def> = MOV32rr %ECX<kill>

The early clobber operand ties ECX input to the ECX def.

The live interval of ECX is represented as this:
%reg20,inf = [46,47:1)[174,230:0)  0@174-(230) 1@46-(47)

The right way to represent this is something like
%reg20,inf = [46,47:2)[174,182:1)[181:230:0)  0@174-(182) 1@181-230 @2@46-(47)

Of course that won't work since that means overlapping live ranges defined by two val#.

The workaround for now is to add a bit to val# which says the val# is redefined by a early clobber def somewhere. This prevents the move at 228 from being optimized away by SimpleRegisterCoalescing::AdjustCopiesBackFrom.

llvm-svn: 61259
2008-12-19 20:58:01 +00:00
Dan Gohman
7b56f8686f LiveRanges are represented as half-open ranges. Fix the findLiveInMBBs code
and the LiveInterval.h top-level comment and accordingly. This fixes blocks
having spurious live-in registers in boundary cases.

llvm-svn: 60092
2008-11-26 05:50:31 +00:00
Dan Gohman
a8c30fb400 Correct a function name in a comment.
llvm-svn: 59143
2008-11-12 16:53:40 +00:00
Evan Cheng
6125b9e097 - More pre-split fixes: spill slot live interval computation bug; restore point bug.
- If a def is spilt, remember its spill index to allow its reuse.

llvm-svn: 58375
2008-10-29 08:39:34 +00:00
Dale Johannesen
bc29bec7f8 Next round of earlyclobber handling. Approach the
RA problem by expanding the live interval of an
earlyclobber def back one slot.  Remove
overlap-earlyclobber throughout.  Remove 
earlyclobber bits and their handling from
live internals.

llvm-svn: 56539
2008-09-24 01:07:17 +00:00
Dale Johannesen
baa4420dc2 Shorten and rearrange data fields to save a word of memory.
Per review feedback.

llvm-svn: 56388
2008-09-20 17:45:21 +00:00
Dale Johannesen
214ddc92d0 Remove AsmThatEarlyClobber etc. from LiveIntervalAnalysis
and redo as linked list walk.  Logic moved into RA.
Per review feedback.

llvm-svn: 56326
2008-09-19 01:02:35 +00:00
Evan Cheng
6e5a126667 Instead of adding an isSS field to LiveInterval to denote stack slot. Use top bit of 'reg' instead. If the top bit is set, than the LiveInterval represents a stack slot live interval.
llvm-svn: 52639
2008-06-23 21:03:19 +00:00
Evan Cheng
2fc7954878 Add a stack slot coloring pass. Not yet enabled.
llvm-svn: 51934
2008-06-04 09:18:41 +00:00
Dan Gohman
3ea2dceca0 Prune and tidy #includes.
llvm-svn: 51697
2008-05-29 19:52:31 +00:00
Evan Cheng
d9353009b7 Fix more -Wshorten-64-to-32 warnings.
llvm-svn: 50659
2008-05-05 18:30:58 +00:00