Owen Anderson
600a8ca0d5
Convert uses of std::vector in TargetInstrInfo to SmallVector. This change had to be propoagated down into all the targets and up into all clients of this API.
...
llvm-svn: 54802
2008-08-14 22:49:33 +00:00
Dan Gohman
027326ba3e
Use empty() instead of begin() == end().
...
llvm-svn: 54780
2008-08-14 18:13:49 +00:00
Owen Anderson
28f2e658f1
Make the allocation of LiveIntervals explicit, rather than holding them in the r2iMap_ by value. This will prevent references to them from being invalidated
...
if the map is changed.
llvm-svn: 54763
2008-08-13 21:49:13 +00:00
Evan Cheng
1b731b8504
Remove #if 0.
...
llvm-svn: 54347
2008-08-05 07:20:57 +00:00
Evan Cheng
754148a2ec
Fix PR2568: Fix bug that cause redudant kill marker after its live interval has been extended due to coalescing.
...
llvm-svn: 54346
2008-08-05 07:10:38 +00:00
Owen Anderson
58d9213c3a
Fix a compile-time regression introduced by my heuristic-changing patch. I forgot
...
to multiply the instruction count by a constant factor in a few places, which
caused the register allocator to require many more iterations.
llvm-svn: 53959
2008-07-23 19:47:27 +00:00
Owen Anderson
7b8947cc31
Change the heuristics used in the coalescer, register allocator, and within
...
live intervals itself to use an instruction count approximation that is
not affected by inserting empty indices.
llvm-svn: 53937
2008-07-22 22:46:49 +00:00
Evan Cheng
d26080487b
Subreg live interval valno may not have a corresponding def machineinstr since it's less precise.
...
llvm-svn: 53734
2008-07-17 19:48:53 +00:00
Owen Anderson
f2386cff4f
Use getMBBEndIdx rather than assuming that the end is right after the last instruction in the block.
...
llvm-svn: 52649
2008-06-23 22:12:23 +00:00
Evan Cheng
1d07cd32c2
Undo spill weight tweak. Need to investigate the performance regressions.
...
llvm-svn: 52572
2008-06-21 06:45:54 +00:00
Evan Cheng
22b431d28f
Coalesce copy from one register class to a sub register class. e.g. X86::MOV16to16_.
...
llvm-svn: 52480
2008-06-19 01:39:21 +00:00
Evan Cheng
3dc2cfe366
When extending a liveinterval by commuting, don't throw away the live ranges that are not affected.
...
llvm-svn: 52430
2008-06-17 20:11:16 +00:00
Owen Anderson
65cfda30bd
The coalescer doesn't need LiveVariables now that we have register use iterators.
...
llvm-svn: 51790
2008-05-30 22:37:27 +00:00
Evan Cheng
cd45b11bc1
Fix PR2289: vr defined by multiple implicit_def as result of coalescing.
...
llvm-svn: 51648
2008-05-28 17:40:10 +00:00
Evan Cheng
8e02953de8
Fix PR2343. An *interesting* coalescer bug.
...
BB1:
vr1025 = copy vr1024
..
BB2:
vr1024 = op
= op vr1025
<loop eventually branch back to BB1>
Even though vr1025 is copied from vr1024, it's not safe to coalesced them since live range of vr1025 intersects the def of vr1024. This happens when vr1025 is assigned the value of the previous iteration of vr1024 in the loop.
llvm-svn: 51394
2008-05-21 22:34:12 +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
Evan Cheng
381b094a2b
Another extract_subreg coalescing bug.
...
e.g.
vr1024<2> extract_subreg vr1025, 2
If vr1024 do not have the same register class as vr1025, it's not safe to coalesce this away. For example, vr1024 might be a GPR32 while vr1025 might be a GPR64.
llvm-svn: 50385
2008-04-29 01:41:44 +00:00
Evan Cheng
1a97cb159e
- Check if a register is livein before removing it. It may have already been removed.
...
- Do not iterate over SmallPtrSet, the order of iteration is not deterministic.
llvm-svn: 50209
2008-04-24 09:06:33 +00:00
Evan Cheng
c215f9f091
Correct comment.
...
llvm-svn: 49913
2008-04-18 19:25:26 +00:00
Evan Cheng
b23895db40
Not safe to "kill" a register if its live range extends pass the end of block branch.
...
llvm-svn: 49911
2008-04-18 19:22:23 +00:00
Evan Cheng
073659986f
Be more careful with insert_subreg and extract_subreg where either source or destination operand has already been coalesced with another register that's defined by a insert_subreg or extract_subreg.
...
llvm-svn: 49843
2008-04-17 07:58:04 +00:00
Bill Wendling
98aab12b63
Use correct name for method in comment.
...
llvm-svn: 49841
2008-04-17 05:20:39 +00:00
Evan Cheng
7c2c3333ca
Fix a sub-register indice propagation bug.
...
llvm-svn: 49832
2008-04-17 00:06:42 +00:00
Evan Cheng
44a0a0c8ee
After reading memory that's already freed.
...
llvm-svn: 49810
2008-04-16 20:24:25 +00:00
Evan Cheng
543905c353
Fix PR2226. Avoid using uninitialized variables.
...
llvm-svn: 49807
2008-04-16 18:48:43 +00:00
Evan Cheng
f99e30e9ee
Avoid read after free.
...
llvm-svn: 49760
2008-04-16 01:22:28 +00:00
Evan Cheng
478e43e7a5
Remove implicit_def instructions that become dead as result of coalescing.
...
llvm-svn: 49513
2008-04-10 23:48:35 +00:00
Evan Cheng
6f164e3814
A copy instruction may use a register multiple times on some targets. Change them all.
...
llvm-svn: 49491
2008-04-10 18:38:47 +00:00
Evan Cheng
def576f9e6
- More aggressively coalescing away copies whose source is defined by an implicit_def.
...
- Added insert_subreg coalescing support.
llvm-svn: 49448
2008-04-09 20:57:25 +00:00
Evan Cheng
f35cc57821
Missed a hasInterval check.
...
llvm-svn: 49415
2008-04-09 01:30:15 +00:00
Evan Cheng
e86caa45cf
- Turn copies of implicit_def into implicit_def instructions.
...
- Be smarter about coalescing copies from implicit_def.
llvm-svn: 49168
2008-04-03 16:41:54 +00:00
Evan Cheng
6fc37c8f25
One more coalescer fix wrt deadness propagation.
...
llvm-svn: 48837
2008-03-26 20:15:49 +00:00
Evan Cheng
8d222d6221
Avoid commuting a def MI in order to coalesce a copy instruction away if any use of the same val# is a copy instruction that has already been coalesced.
...
llvm-svn: 48833
2008-03-26 19:03:01 +00:00
Evan Cheng
7c1dcd8371
lastRegisterUse() should ignore identity copies. Those will be erased.
...
llvm-svn: 48759
2008-03-25 02:02:19 +00:00
Evan Cheng
2213deac2e
If the coalescer commuted a def MI to allow coalescing, it can changed a previously coalesced copy into an non-identity copy.
...
llvm-svn: 48752
2008-03-24 23:31:21 +00:00
Evan Cheng
32a6116ffd
A couple of kill marker maintainence bug.
...
llvm-svn: 48653
2008-03-21 19:09:30 +00:00
Evan Cheng
e9aa507edc
Fixed a coalescer bug caused by a typo.
...
llvm-svn: 48526
2008-03-19 02:26:36 +00:00
Evan Cheng
5750c3cd1e
Rewrite code that propagate isDead information after a dead copy is coalesced. This remove some ugly spaghetti code and fixed a number of subtle bugs.
...
llvm-svn: 48490
2008-03-18 08:26:47 +00:00
Evan Cheng
6b57844f0c
Remove unused options.
...
llvm-svn: 48319
2008-03-13 02:41:34 +00:00
Evan Cheng
02b66c3a32
- Fix a subtle bug in RemoveCopyByCommutingDef. ALR is the live range where the source is defined; BLR is the live range which is defined by the copy.
...
If ALR and BLR overlaps and end of BLR extends beyond end of ALR, e.g.
A = or A, B
...
B = A
...
C = A<kill>
...
= B
then do not add kills of A to the newly created B interval.
- Also fix some kill info update bug.
llvm-svn: 48141
2008-03-10 08:11:32 +00:00
Evan Cheng
8f5092bea8
Fix a coalescer bug wrt how dead copy interval is shortened.
...
llvm-svn: 47966
2008-03-05 22:09:42 +00:00
Evan Cheng
18064ddb5b
Refactor code. Remove duplicated functions that basically do the same thing as
...
findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies.
llvm-svn: 47927
2008-03-05 00:59:57 +00:00
Evan Cheng
f6d76f2e52
No need for coalescer to update kills. Only copies are coalesced and those instructions will be deleted. Doh.
...
llvm-svn: 47749
2008-02-29 02:50:03 +00:00
Bill Wendling
8fb166bf6c
Rename PrintableName to Name.
...
llvm-svn: 47629
2008-02-26 21:47:57 +00:00
Bill Wendling
50f5c4be14
Change "Name" to "AsmName" in the target register info. Gee, a refactoring tool
...
would have been a Godsend here!
llvm-svn: 47625
2008-02-26 21:11:01 +00:00
Evan Cheng
701b6a1dc3
Enable -coalescer-commute-instrs by default.
...
llvm-svn: 47623
2008-02-26 20:40:22 +00:00
Evan Cheng
8e99554e84
This is possible:
...
vr1 = extract_subreg vr2, 3
...
vr3 = extract_subreg vr1, 2
The end result is vr3 is equal to vr2 with subidx 2.
llvm-svn: 47592
2008-02-26 08:03:41 +00:00
Evan Cheng
e16e349623
Fix compiler warning.
...
llvm-svn: 47468
2008-02-22 01:48:00 +00:00
Evan Cheng
8072166220
Help testing.
...
llvm-svn: 47448
2008-02-21 19:20:21 +00:00