Commit Graph

30 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 0c76d6ec21 Replace copyRegToReg with COPY everywhere in lib/CodeGen except for FastISel.
llvm-svn: 108062
2010-07-10 22:42:59 +00:00
Dan Gohman 9a2f0473b2 Teach EmitLiveInCopies to omit copies for unused virtual registers,
and to clean up unused incoming physregs from the live-in list.

llvm-svn: 106805
2010-06-24 22:23:02 +00:00
Dan Gohman e5457c275d Don't leak RegClass2VRegMap, which is now a new[] array instead of a
std::vector.

llvm-svn: 106298
2010-06-18 18:54:05 +00:00
Dan Gohman 882bb2984e Start TargetRegisterClass indices at 0 instead of 1, so that
MachineRegisterInfo doesn't have to confusingly allocate an extra
entry.

llvm-svn: 106296
2010-06-18 18:13:55 +00:00
Benjamin Kramer c488e92f0b Remove unused function.
llvm-svn: 105100
2010-05-29 14:03:51 +00:00
Evan Cheng 707b7cc429 Remove schedule-livein-copies. It's not being used.
llvm-svn: 105095
2010-05-29 02:23:39 +00:00
Evan Cheng 1b79babdec Avoid adding duplicate function live-in's.
llvm-svn: 104560
2010-05-24 21:33:37 +00:00
Dan Gohman 7767d2747b Add a utility function for conservatively clearing kill flags, and make
use of it in MachineCSE.

llvm-svn: 103726
2010-05-13 19:24:00 +00:00
Jakob Stoklund Olesen f25be99109 Silence warning
llvm-svn: 103508
2010-05-11 20:51:04 +00:00
Jakob Stoklund Olesen 3f0241e0f9 Simplify the tracking of used physregs to a bulk bitor followed by a transitive
closure after allocating all blocks.

Add a few more test cases for -regalloc=fast.

llvm-svn: 103500
2010-05-11 20:30:28 +00:00
Dan Gohman 779c69bbc5 Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that it
doesn't have to guess.

llvm-svn: 103194
2010-05-06 20:33:48 +00:00
Evan Cheng 6e822459ed Replace r102368 with code that's less fragile. This creates DBG_VALUE instructions for function arguments early and insert them after instruction selection is done.
llvm-svn: 102554
2010-04-28 23:08:54 +00:00
Evan Cheng 0e6fc61f21 Insert dbg_value instructions for function entry block liveins (i.e. function arguments).
llvm-svn: 102368
2010-04-26 19:16:00 +00:00
Dan Gohman 2ca8fb229c Move the code for initialing the entry block livein set out of
SelectionDAGISel.

llvm-svn: 101258
2010-04-14 17:05:00 +00:00
Dan Gohman 2b79ee8bc8 Move the code for emitting livein copies out of SelectionDAGISel.
llvm-svn: 101254
2010-04-14 16:51:49 +00:00
Dan Gohman 6b1b1e4358 Move MachineRegisterInfo's isLiveIn and isLiveOut out of line.
llvm-svn: 101145
2010-04-13 16:55:37 +00:00
Evan Cheng f94d68398a Add MachineRegisterInfo::hasOneUse and hasOneNonDBGUse.
llvm-svn: 97663
2010-03-03 21:18:38 +00:00
Dan Gohman e603710d11 Simplify a few more uses of reg_iterator.
llvm-svn: 82812
2009-09-25 22:26:13 +00:00
Evan Cheng 1283c6a066 Part 1.
- Change register allocation hint to a pair of unsigned integers. The hint type is zero (which means prefer the register specified as second part of the pair) or entirely target dependent.
- Allow targets to specify alternative register allocation orders based on allocation hint.

Part 2.
- Use the register allocation hint system to implement more aggressive load / store multiple formation.
- Aggressively form LDRD / STRD. These are formed *before* register allocation. It has to be done this way to shorten live interval of base and offset registers. e.g.
v1025 = LDR v1024, 0
v1026 = LDR v1024, 0
=>
v1025,v1026 = LDRD v1024, 0

If this transformation isn't done before allocation, v1024 will overlap v1025 which means it more difficult to allocate a register pair.

- Even with the register allocation hint, it may not be possible to get the desired allocation. In that case, the post-allocation load / store multiple pass must fix the ldrd / strd instructions. They can either become ldm / stm instructions or back to a pair of ldr / str instructions.

This is work in progress, not yet enabled.

llvm-svn: 73381
2009-06-15 08:28:29 +00:00
Evan Cheng 085caf10be 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
Dan Gohman 210448c233 Move MachineRegisterInfo::setRegClass out of line.
llvm-svn: 69126
2009-04-15 01:19:35 +00:00
Dan Gohman 91dfc08809 Move createVirtualRegister out-of-line.
llvm-svn: 60684
2008-12-08 04:54:11 +00:00
Evan Cheng bc623edaba Add a register class -> virtual registers map.
llvm-svn: 57844
2008-10-20 20:03:28 +00:00
Dan Gohman 14ce7d1eba Assert that all MachineInstrs update PhysRegUseDefLists in
their cleanup code. 

llvm-svn: 53194
2008-07-07 19:55:35 +00:00
Evan Cheng 61732d994e Added debugging routine dumpUses.
llvm-svn: 47042
2008-02-13 02:45:38 +00:00
Dan Gohman 3a4be0fdef Rename MRegisterInfo to TargetRegisterInfo.
llvm-svn: 46930
2008-02-10 18:45:23 +00:00
Chris Lattner 0cb9dd7aa2 switch the register iterator to act more like hte LLVM value iterator: dereferencing
it now returns the machineinstr of the use.  To get the operand, use I.getOperand().

Add a new MachineRegisterInfo::replaceRegWith, which is basically like
Value::replaceAllUsesWith.

llvm-svn: 45482
2008-01-01 20:36:19 +00:00
Chris Lattner 39204d76c5 Add a trivial but handy function to efficiently return the machine
instruction that defines the specified vreg.  Crazy.

llvm-svn: 45480
2008-01-01 03:07:29 +00:00
Chris Lattner 961e7427ea Implement automatically updated def/use lists for all MachineInstr register
operands.  The lists are currently kept in MachineRegisterInfo, but it does
not yet provide an iterator interface to them.

llvm-svn: 45477
2008-01-01 01:12:31 +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