1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

156 Commits

Author SHA1 Message Date
Dan Gohman
1e7dff35a6 Drop the reg argument to isRegReDefinedByTwoAddr, which was redundant.
llvm-svn: 60586
2008-12-05 05:45:42 +00:00
Matthijs Kooijman
b316bd9e62 Minor fix debug for register allocation debug output.
llvm-svn: 59961
2008-11-24 16:01:21 +00:00
Dan Gohman
9543edc4ef 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
Owen Anderson
7f99714393 Fix the case where an instruction is not properly marked as using all registers that alias its inputs.
llvm-svn: 57286
2008-10-08 04:30:51 +00:00
Dan Gohman
638a8001c8 Fix a bug in the local allocator's liveness computation where it
was setting kill flags on tied uses in two-address instructions.
The kill flags were causing the allocator to think it could
allocate the use and its tied def in different registers.

llvm-svn: 57039
2008-10-04 00:31:14 +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
Dale Johannesen
4184c23365 Remove SelectionDag early allocation of registers
for earlyclobbers.  Teach Local RA about earlyclobber,
and add some tests for it.

llvm-svn: 56592
2008-09-24 23:13:09 +00:00
Dan Gohman
fa32c7c6d9 Remove isImm(), isReg(), and friends, in favor of
isImmediate(), isRegister(), and friends, to avoid confusion
about having two different names with the same meaning. I'm
not attached to the longer names, and would be ok with
changing to the shorter names if others prefer it.

llvm-svn: 56189
2008-09-13 17:58:21 +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
Chris Lattner
fd64cbf22d consolidate DenseMapInfo implementations, and add one for std::pair.
Patch contributed by m-s.

llvm-svn: 55167
2008-08-22 05:08:25 +00:00
Evan Cheng
d7023b66ea Change StackSlotForVirtReg (which maps vregs to frame indices) from std::map to IndexedMap.
llvm-svn: 53414
2008-07-10 18:23:23 +00:00
Evan Cheng
3ec3113431 - Change the horrible N^2 isRegReDefinedByTwoAddr. Now callers must supply the operand index of def machineoperand and at most one full scan of non-implicit operands is needed.
- Change local register allocator to use the new isRegReDefinedByTwoAddr instead of reinventing the wheel.

llvm-svn: 53394
2008-07-10 07:35:43 +00:00
Owen Anderson
65e43ae1e8 Use DenseMap instead of std::map in local register allocation. This improves the time on instcombine from .31s to .22s
llvm-svn: 53390
2008-07-10 01:56:35 +00:00
Owen Anderson
189609bb36 Fix 403.gcc. Finally got the check for two-address-ness correct.
llvm-svn: 53389
2008-07-10 01:53:01 +00:00
Owen Anderson
35080ed650 Revert r53367, which was breaking things.
llvm-svn: 53378
2008-07-09 23:09:10 +00:00
Owen Anderson
8174cf28a3 Loosen our check here. Local regalloc only cares that the reg is used and def'd by the same instruction, but about the details of
the relationship.

llvm-svn: 53367
2008-07-09 21:34:36 +00:00
Owen Anderson
50a64de51e Don't use an expensive check for two-address-ness when we have the information sitting around to determine it much more quickly,
This speeds up the local register allocator from 0.37s to 0.31s on instcombine.

llvm-svn: 53359
2008-07-09 21:15:10 +00:00
Owen Anderson
58912683fd Factor local liveness computation out into its own function.
llvm-svn: 53352
2008-07-09 20:14:53 +00:00
Dan Gohman
0975e33ffc Reuse the MO variable instead of recomputing it in RegAllocLocal.
Keep RegAllocSimple in sync.

llvm-svn: 53351
2008-07-09 20:12:26 +00:00
Dan Gohman
ad2c9877ce RegAllocLocal has a TargetInstrInfo data member. Use it instead
of having local variables duplicate it.

llvm-svn: 53346
2008-07-09 19:55:19 +00:00
Dan Gohman
4d221ae533 Use find with std::map, when that's what's needed, instead of lower_bound
with extra checks.

llvm-svn: 53344
2008-07-09 19:51:00 +00:00
Owen Anderson
d90ae5127e Fix the build. Apparently MachineInstr& is no longer implicitly convertable to MachineBasicBlock::iterator.
llvm-svn: 53260
2008-07-08 23:36:37 +00:00
Owen Anderson
caf8cb40e8 Make the local register allocator compute (purely local) liveness information for itself
rather than depending on LiveVariables.  This decreases compile time from:
0.5909s (LV + Regalloc) to 0.421s (just regalloc).

llvm-svn: 53256
2008-07-08 22:24:50 +00:00
Evan Cheng
591b57edd6 Teach local register allocator to deal with landing pad MBB's.
llvm-svn: 51647
2008-05-28 17:22:32 +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
4e841d67ed Remove #include<map> from LiveVariables.h. Not referenced.
llvm-svn: 49099
2008-04-02 17:23:50 +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
Bill Wendling
d0f85a5ca3 If we reload a virtual register that's already been assigned, we want to mark
that instruction as its "last use". This fixes PR1925.

llvm-svn: 47758
2008-02-29 18:52:01 +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
b8e7eb2b1b Really really bad local register allocator bug. On X86, it was never using ESI, EDI, and EBP because of a bug in RALocal::isPhysRegAvailable(). For example, when
it checks if ESI is available, it then looks at registers aliases to ESI. SIL is marked -2 (not allocatable) but isPhysRegAvailable() incorrectly assumes it is in use and returns false for ESI.

llvm-svn: 47499
2008-02-22 20:30:53 +00:00
Evan Cheng
e24db258fe Add debugging printfs.
llvm-svn: 47496
2008-02-22 19:57:06 +00:00
Anton Korobeynikov
c41f5b6af4 Fix newly-introduced 4.3 warnings
llvm-svn: 47375
2008-02-20 12:07:57 +00:00
Evan Cheng
19f684ed72 Determine whether a spill kills the register it's spilling before insertion rather than trying to undo the kill marker afterwards.
llvm-svn: 46953
2008-02-11 08:30:52 +00:00
Dan Gohman
cabaec582f Rename MRegisterInfo to TargetRegisterInfo.
llvm-svn: 46930
2008-02-10 18:45:23 +00:00
Evan Cheng
0c6aedd740 Remove remnant of load folding in local register allocator. Patch by Holger Schurig.
llvm-svn: 46861
2008-02-07 19:46:55 +00:00
Evan Cheng
2091d9a2e8 Fix a number of local register allocator issues: PR1609.
llvm-svn: 46821
2008-02-06 19:16:53 +00:00
Evan Cheng
34815d69b2 RegAllocaLocal still *requires* LiveVariables since it runs PHIElimination, followed by TwoAddress which requires LiveVariables. We cannot run LiveVariables on non-SSA code.
llvm-svn: 46813
2008-02-06 08:00:32 +00:00
Owen Anderson
1078560f26 Reg alloc doesn't really need LiveVariables.
llvm-svn: 46420
2008-01-27 22:00:00 +00:00
Evan Cheng
8633da0707 When a live virtual register is being clobbered by an implicit def, it is spilled
and the spill is its kill. However, if the local allocator has determined the
register has not been modified (possible when its value was reloaded), it would
not issue a restore. In that case, mark the last use of the virtual register as
kill.

llvm-svn: 46111
2008-01-17 02:08:17 +00:00
Evan Cheng
a637a9c2f5 Replace std::vector<bool> with BitVector.
llvm-svn: 46104
2008-01-17 00:35:26 +00:00
Chris Lattner
f83aae613c 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
Owen Anderson
2e866e9cdf Update CodeGen for MRegisterInfo --> TargetInstrInfo changes.
llvm-svn: 45673
2008-01-07 01:35:56 +00:00
Owen Anderson
e6856128ab Move some more instruction creation methods from RegisterInfo into InstrInfo.
llvm-svn: 45484
2008-01-01 21:11:32 +00:00
Chris Lattner
96167aa93c 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
Chris Lattner
ad9a6ccb83 Remove attribution from file headers, per discussion on llvmdev.
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Evan Cheng
8464a0bf00 Add a argument to storeRegToStackSlot and storeRegToAddr to specify whether
the stored register is killed.

llvm-svn: 44600
2007-12-05 03:14:33 +00:00
Evan Cheng
58b387dfb0 Remove redundant foldMemoryOperand variants and other code clean up.
llvm-svn: 44517
2007-12-02 08:30:39 +00:00
Evan Cheng
fdd01c99f2 Add missing paratheses.
llvm-svn: 43227
2007-10-22 19:42:28 +00:00
Evan Cheng
5c0f03bce4 Correctly handle implcit def / use operands.
llvm-svn: 37740
2007-06-26 21:05:13 +00:00