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
Evan Cheng
ff9c1655de
Special handling of zero-sized live intervals.
...
llvm-svn: 49167
2008-04-03 16:40:27 +00:00
Bill Wendling
ebb707d162
Detabify
...
llvm-svn: 47597
2008-02-26 10:49:39 +00:00
Evan Cheng
bb357cd8a6
- Removing the infamous r2rMap_ and rep() method. Now the coalescer will update
...
register defs and uses after each successful coalescing.
- Also removed a number of hacks and fixed some subtle kill information bugs.
llvm-svn: 47167
2008-02-15 18:24:29 +00:00
Evan Cheng
da24989368
- Added removeValNo() to remove all live ranges of a particular value#.
...
- removeRange() can now update value# information.
llvm-svn: 47044
2008-02-13 02:48:26 +00:00
Dan Gohman
cabaec582f
Rename MRegisterInfo to TargetRegisterInfo.
...
llvm-svn: 46930
2008-02-10 18:45:23 +00:00
Chris Lattner
e0b1ee937a
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change. Boy are my fingers tired. ;-)
llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Evan Cheng
72fe4454e6
Replace the odd kill# hack with something less fragile.
...
llvm-svn: 44434
2007-11-29 09:49:23 +00:00
Evan Cheng
7e785103df
Update comments.
...
llvm-svn: 43064
2007-10-17 02:16:40 +00:00
Evan Cheng
62ee7cd439
When coalescing an EXTRACT_SUBREG and the dst register is a physical register,
...
the source register will be coalesced to the super register of the LHS. Properly
merge in the live ranges of the resulting coalesced interval that were part of
the original source interval to the live interval of the super-register.
llvm-svn: 42961
2007-10-14 10:08:34 +00:00
Evan Cheng
d11cd4a095
EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG like
...
(almost) a register copy. However, it always coalesced to the register of the
RHS (the super-register). All uses of the result of a EXTRACT_SUBREG are sub-
register uses which adds subtle complications to load folding, spiller rewrite,
etc.
llvm-svn: 42899
2007-10-12 08:50:34 +00:00
David Greene
04a132ad5f
Constify to catch bugs.
...
llvm-svn: 41751
2007-09-06 19:46:46 +00:00
Evan Cheng
884b7c0c81
Accidentially left this out.
...
llvm-svn: 41730
2007-09-05 21:58:18 +00:00
Evan Cheng
3bda699975
Use pool allocator for all the VNInfo's to improve memory access locality. This reduces coalescing time on siod Mac OS X PPC by 35%. Also remove the back ptr from VNInfo to LiveInterval and other tweaks.
...
llvm-svn: 41729
2007-09-05 21:46:51 +00:00
Evan Cheng
3157d0991b
Remove an unnecessary element, saving 4 bytes per LiveInterval.
...
llvm-svn: 41641
2007-08-31 08:26:44 +00:00
Evan Cheng
5a5046b83f
Change LiveRange so it keeps a pointer to the VNInfo rather than an index.
...
Changes related modules so VNInfo's are not copied. This decrease
copy coalescing time by 45% and overall compilation time by 10% on siod.
llvm-svn: 41579
2007-08-29 20:45:00 +00:00
Evan Cheng
1f3724ee2d
Recover most of the compile time regression due to recent live interval changes.
...
1. Eliminate the costly live interval "swapping".
2. Change ValueNumberInfo container from SmallVector to std::vector. The former
performs slowly when the vector size is very large.
llvm-svn: 41536
2007-08-28 08:28:51 +00:00
Dan Gohman
e2c92effea
Add explicit keywords and remove spurious trailing semicolons.
...
llvm-svn: 41482
2007-08-27 14:50:10 +00:00
Evan Cheng
e2bb505d7c
Comments.
...
llvm-svn: 41119
2007-08-16 07:25:37 +00:00
Evan Cheng
215f802b75
Re-implement trivial rematerialization. This allows def MIs whose live intervals that are coalesced to be rematerialized.
...
llvm-svn: 41060
2007-08-13 23:45:17 +00:00
Evan Cheng
8968affb6d
Code to maintain kill information during register coalescing.
...
llvm-svn: 41016
2007-08-11 00:59:19 +00:00
Evan Cheng
5227e36428
Adding kill info to val#.
...
llvm-svn: 40925
2007-08-08 07:03:29 +00:00
Evan Cheng
02e7fbd7c8
Clean up and bug fix.
...
llvm-svn: 40921
2007-08-08 05:56:18 +00:00
Evan Cheng
12d72cc1a0
- Each val# can have multiple kills.
...
- Fix some minor bugs related to special markers on val# def. ~0U means
undefined, ~1U means dead val#.
llvm-svn: 40916
2007-08-08 03:00:28 +00:00
Evan Cheng
0182b495fd
- LiveInterval value#'s now have 3 components: def instruction #,
...
kill instruction #, and source register number (iff the value# is defined by a
copy).
- Now def instruction # is set for every value#, not just for copy defined ones.
- Update some outdated code related inactive live ranges.
- Kill info not yet set. That's next patch.
llvm-svn: 40913
2007-08-07 23:49:57 +00:00
Evan Cheng
c5d2df366a
Add a register allocation preference field; add a method to compute size of a live interval.
...
llvm-svn: 36216
2007-04-17 20:25:11 +00:00