Evan Cheng
94169f1021
Fix PR2898. Spiller delete a store for reuse before it knows for sure the reuse happened.
...
Patch by Lang Hames!
llvm-svn: 57720
2008-10-17 20:56:41 +00:00
Evan Cheng
08acb24225
Fix a very subtle spiller bug: UpdateKills should not forget to track defs of aliases.
...
llvm-svn: 57673
2008-10-17 06:16:07 +00:00
Dan Gohman
9c4b7d5c4f
Fix command-line option printing to print two spaces where needed,
...
instead of requiring all "short description" strings to begin with
two spaces. This makes these strings less mysterious, and it fixes
some cases where short description strings mistakenly did not
begin with two spaces.
llvm-svn: 57521
2008-10-14 20:25:08 +00:00
Dan Gohman
dfe979bcb0
Don't dereference the end() iterator. Thanks to
...
ENABLE_EXPENSIVE_CHECKS for finding this.
llvm-svn: 57181
2008-10-06 18:00:07 +00:00
Dan Gohman
0d1e9a8e04
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
Evan Cheng
b401449ceb
Propagate subreg index when promoting a load to a copy.
...
llvm-svn: 56085
2008-09-11 01:02:12 +00:00
Evan Cheng
534fe1c405
Fix PR2664 - spiller GetRegForReload wasn't respecting sub-register indices on machine operands.
...
llvm-svn: 56065
2008-09-10 20:08:45 +00:00
Evan Cheng
93d40ae1e1
Fix an overly strict assertion. Source register of a copy may not be killed, it may be killed by an implicit super-register use.
...
llvm-svn: 55762
2008-09-04 05:43:55 +00:00
Owen Anderson
7f3bfbd23b
Make SimpleSpiller respect subregister indices.
...
llvm-svn: 54968
2008-08-19 01:05:33 +00:00
Evan Cheng
aa33b932bd
Fix PR2596: out of bound reference.
...
llvm-svn: 54375
2008-08-05 21:51:46 +00:00
Dan Gohman
597bd1633e
Fix a LocalSpiller leak. This fixes tramp3d-v4.
...
llvm-svn: 53766
2008-07-18 18:28:56 +00:00
Dan Gohman
3b46030375
Pool-allocation for MachineInstrs, MachineBasicBlocks, and
...
MachineMemOperands. The pools are owned by MachineFunctions.
This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.
llvm-svn: 53212
2008-07-07 23:14:23 +00:00
Evan Cheng
50d59478da
Cosmetic.
...
llvm-svn: 52450
2008-06-18 07:47:28 +00:00
Evan Cheng
51c75c0c95
Fix read after free found by valgrind.
...
llvm-svn: 52309
2008-06-16 07:34:17 +00:00
Evan Cheng
fb79059b85
Teach the spiller to commute instructions in order to fold a reload. This hits 410 times on 444.namd and 122 times on 252.eon.
...
llvm-svn: 52266
2008-06-13 23:58:02 +00:00
Evan Cheng
eecdf659e8
Move #include to right place.
...
llvm-svn: 51932
2008-06-04 09:16:33 +00:00
Bill Wendling
6e326bf0fb
Remove warnings about comparison between signed and unsigned expressions.
...
llvm-svn: 51465
2008-05-23 01:29:08 +00:00
David Greene
54b52fe13b
Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
...
generated by the spiller.
llvm-svn: 51439
2008-05-22 21:12:21 +00:00
Evan Cheng
0609ab646b
More local spiller complexity!
...
If local spiller optimization turns some instruction into an identity copy, it will be removed. If the output register happens to be dead (and source is obviously killed), transfer the kill / dead information to last use / def in the same MBB.
llvm-svn: 51306
2008-05-20 08:13:21 +00:00
Dan Gohman
d78c400b5b
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
7ca4a67ca1
Yet another nasty spiller bug.
...
%ecx = op
store %cl<kill>, (addr)
(addr) = op %al
It's not safe to unfold the last operand and eliminate store even though %cl is marked kill. It's a sub-register use which means one of its super-register(s) may be used below.
llvm-svn: 50794
2008-05-07 00:49:28 +00:00
Evan Cheng
499ffa9055
Use of implicit_def is not part of live interval. Create empty intervals for the uses when the live interval is being spilled.
...
llvm-svn: 49542
2008-04-11 17:53:36 +00:00
Evan Cheng
ed6e34fe41
Move reMaterialize() from TargetRegisterInfo to TargetInstrInfo.
...
llvm-svn: 48995
2008-03-31 20:40:39 +00:00
Evan Cheng
289ba4f335
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
8c19af1b7e
A couple of kill marker maintainence bug.
...
llvm-svn: 48653
2008-03-21 19:09:30 +00:00
Evan Cheng
84aec09fdb
Fix PR2138. Apparently any modification to a std::multimap (including remove entries for a different key) can invalidate multimap iterators.
...
llvm-svn: 48371
2008-03-14 20:44:01 +00:00
Dan Gohman
34ae72c435
Change VirtRegMap's dump to dump to cerr, not DOUT, so that it
...
can be called from within a debuger without having -debug specified
on the command-line.
llvm-svn: 48298
2008-03-12 20:52:10 +00:00
Evan Cheng
105cb3988b
Set NextMII after issuing a physical register spill.
...
llvm-svn: 48263
2008-03-12 00:14:07 +00:00
Evan Cheng
b398635456
Minor debug output bug.
...
llvm-svn: 48261
2008-03-12 00:02:46 +00:00
Evan Cheng
a3891365b5
Transfer physical register spill info when load / store folding happens.
...
llvm-svn: 48246
2008-03-11 21:34:46 +00:00
Evan Cheng
e88a625ecd
When the register allocator runs out of registers, spill a physical register around the def's and use's of the interval being allocated to make it possible for the interval to target a register and spill it right away and restore a register for uses. This likely generates terrible code but is before than aborting.
...
llvm-svn: 48218
2008-03-11 07:19:34 +00:00
Evan Cheng
6325446666
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
fdc732ab9a
Fix a bug in dead spill slot elimination.
...
llvm-svn: 47687
2008-02-27 19:57:11 +00:00
Bill Wendling
97925ec704
Final de-tabification.
...
llvm-svn: 47663
2008-02-27 06:33:05 +00:00
Evan Cheng
6d56368caf
Spiller now remove unused spill slots.
...
llvm-svn: 47657
2008-02-27 03:04:06 +00:00
Bill Wendling
d7a258d325
Rename PrintableName to Name.
...
llvm-svn: 47629
2008-02-26 21:47:57 +00:00
Bill Wendling
c24ea4fb41
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
Bill Wendling
7bb51dfbb1
De-tabify.
...
llvm-svn: 47598
2008-02-26 10:51:52 +00:00
Evan Cheng
ea1ef87ea2
Make sure reload of implicit uses are issued before remat's.
...
llvm-svn: 47492
2008-02-22 19:22:06 +00:00
Evan Cheng
c373911461
Enable re-materialization of instructions which have virtual register operands if
...
the definition of the operand also reaches its uses.
llvm-svn: 47475
2008-02-22 09:24:50 +00:00
Anton Korobeynikov
035eaacd1f
Update gcc 4.3 warnings fix patch with recent head changes
...
llvm-svn: 47368
2008-02-20 11:10:28 +00:00
Dan Gohman
3a4be0fdef
Rename MRegisterInfo to TargetRegisterInfo.
...
llvm-svn: 46930
2008-02-10 18:45:23 +00:00
Evan Cheng
f2bd1387b0
Forgot these files.
...
llvm-svn: 46896
2008-02-08 22:05:27 +00:00
Chris Lattner
03ad885039
rename TargetInstrDescriptor -> TargetInstrDesc.
...
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.
llvm-svn: 45695
2008-01-07 07:27:27 +00:00
Chris Lattner
b0d06b4381
Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor
...
llvm-svn: 45680
2008-01-07 03:13:06 +00:00
Chris Lattner
a98c679de0
Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
...
that it is cheap and efficient to get.
Move a variety of predicates from TargetInstrInfo into
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around. Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.
Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.
llvm-svn: 45674
2008-01-07 01:56:04 +00:00
Owen Anderson
0ec92e9d64
Update CodeGen for MRegisterInfo --> TargetInstrInfo changes.
...
llvm-svn: 45673
2008-01-07 01:35:56 +00:00
Owen Anderson
eee14601b1
Move some more instruction creation methods from RegisterInfo into InstrInfo.
...
llvm-svn: 45484
2008-01-01 21:11:32 +00:00
Owen Anderson
7a73ae9a86
Move copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of the
...
Machine-level API cleanup instigated by Chris.
llvm-svn: 45470
2007-12-31 06:32:00 +00:00
Chris Lattner
a10fff51d9
Rename SSARegMap -> MachineRegisterInfo in keeping with the idea
...
that "machine" classes are used to represent the current state of
the code being compiled. Given this expanded name, we can start
moving other stuff into it. For now, move the UsedPhysRegs and
LiveIn/LoveOuts vectors from MachineFunction into it.
Update all the clients to match.
This also reduces some needless #includes, such as MachineModuleInfo
from MachineFunction.
llvm-svn: 45467
2007-12-31 04:13:23 +00:00