summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveRangeEdit.h
Commit message (Collapse)AuthorAgeFilesLines
* Moved LiveRangeEdit.h so that it can be called from other parts of the ↵Pete Cooper2012-04-021-202/+0
| | | | | | backend, not just libCodeGen llvm-svn: 153906
* Refactored the LiveRangeEdit interface so that MachineFunction, ↵Pete Cooper2012-04-021-20/+21
| | | | | | TargetInstrInfo, MachineRegisterInfo, LiveIntervals, and VirtRegMap are all passed into the constructor and stored as members instead of passed in to each method. llvm-svn: 153903
* Kill off LiveRangeEdit::getNewVRegs and LiveRangeEdit::getUselessVRegs. TheseLang Hames2012-02-281-13/+1
| | | | | | | | methods are no longer needed now that LinearScan has gone away. (Contains tweaks trivialSpillEverywhere to enable the removal of getNewVRegs). llvm-svn: 151658
* Unweaken vtables as per ↵David Blaikie2011-12-201-1/+3
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146960
* Fixed register allocator splitting a live range on a spilling variable.Pete Cooper2011-12-121-1/+6
| | | | | | | | If we create new intervals for a variable that is being spilled, then those new intervals are not guaranteed to also spill. This means that anything reading from the original spilling value might not get the correct value if spills were missed. Fixes <rdar://problem/10546864> llvm-svn: 146428
* Migrate LLVM and Clang to use the new makeArrayRef(...) functions where ↵Frits van Bommel2011-07-181-1/+1
| | | | | | | | previously explicit non-default constructors were used. Mostly mechanical with some manual reformatting. llvm-svn: 135390
* Update LiveDebugVariables after live range splitting.Jakob Stoklund Olesen2011-05-061-1/+6
| | | | | | | | | | | | After a virtual register is split, update any debug user variables that resided in the old register. This ensures that the LiveDebugVariables are still correct after register allocation. This may create DBG_VALUE instructions that place a user variable in a register in parts of the function and in a stack slot in other parts. DwarfDebug currently doesn't support that. llvm-svn: 130998
* Minimize the slot indexes spanned by register ranges created when splitting.Jakob Stoklund Olesen2011-05-021-1/+2
| | | | | | | | | | | | | When an interfering live range ends at a dead slot index between two instructions, make sure that the inserted copy instruction gets a slot index after the dead ones. This makes it possible to avoid the interference. Ideally, there shouldn't be interference ending at a deleted instruction, but physical register coalescing can sometimes do that to sub-registers. This fixes PR9823. llvm-svn: 130687
* Add debug output for rematerializable instructions.Jakob Stoklund Olesen2011-04-201-1/+1
| | | | llvm-svn: 129883
* When dead code elimination removes all but one use, try to fold the single ↵Jakob Stoklund Olesen2011-04-051-0/+5
| | | | | | | | def into the remaining use. Rematerialization can leave single-use loads behind that we might as well fold whenever possible. llvm-svn: 128918
* Treat clones the same as their origin.Jakob Stoklund Olesen2011-03-301-0/+4
| | | | | | | | | | | | When DCE clones a live range because it separates into connected components, make sure that the clones enter the same register allocator stage as the register they were cloned from. For instance, clones may be split even when they where created during spilling. Other registers created during spilling are not candidates for splitting or even (re-)spilling. llvm-svn: 128524
* Recompute register class and hint for registers created during spilling.Jakob Stoklund Olesen2011-03-291-0/+5
| | | | | | The spill weight is not recomputed for an unspillable register - it stays infinite. llvm-svn: 128490
* Properly enable rematerialization when spilling after live range splitting.Jakob Stoklund Olesen2011-03-291-0/+5
| | | | | | | | The instruction to be rematerialized may not be the one defining the register that is being spilled. The traceSiblingValue() function sees through sibling copies to find the remat candidate. llvm-svn: 128449
* Use individual register classes when spilling snippets.Jakob Stoklund Olesen2011-03-261-3/+3
| | | | | | | | | The main register class may have been inflated by live range splitting, so that register class is not necessarily valid for the snippet instructions. Use the original register class for the stack slot interval. llvm-svn: 128351
* Dead code elimination may separate the live interval into multiple connected ↵Jakob Stoklund Olesen2011-03-171-3/+8
| | | | | | | | | components. I have convinced myself that it can only happen when a phi value dies. When it happens, allocate new virtual registers for the components. llvm-svn: 127827
* Add a LiveRangeEdit delegate callback before shrinking a live range.Jakob Stoklund Olesen2011-03-161-0/+3
| | | | | | The register allocator needs to adjust its live interval unions when that happens. llvm-svn: 127774
* Tell the register allocator about new unused virtual registers.Jakob Stoklund Olesen2011-03-131-0/+9
| | | | | | | This allows the allocator to free any resources used by the virtual register, including physical register assignments. llvm-svn: 127560
* Change the Spiller interface to take a LiveRangeEdit reference.Jakob Stoklund Olesen2011-03-101-1/+8
| | | | | | | This makes it possible to register delegates and get callbacks when the spiller edits live ranges. llvm-svn: 127389
* Add a virtual dtor to Delegate to silence -Wnon-virtual-dtorMatt Beaumont-Gay2011-03-091-0/+1
| | | | llvm-svn: 127311
* Add a LiveRangeEdit::Delegate protocol.Jakob Stoklund Olesen2011-03-091-2/+15
| | | | | | | This will we used for keeping register allocator data structures up to date while LiveRangeEdit is trimming live intervals. llvm-svn: 127300
* Delete dead code after rematerializing.Jakob Stoklund Olesen2011-03-081-0/+8
| | | | | | | | LiveRangeEdit::eliminateDeadDefs() will eventually be used by coalescing, splitting, and spilling for dead code elimination. It can delete chains of dead instructions as long as there are no dependency loops. llvm-svn: 127287
* Make the UselessRegs argument optional in the LiveRangeEdit constructor.Jakob Stoklund Olesen2011-03-071-3/+3
| | | | llvm-svn: 127181
* Transfer simply defined values directly without recomputing liveness and SSA.Jakob Stoklund Olesen2011-03-021-4/+4
| | | | | | | | Values that map to a single new value in a new interval after splitting don't need new PHIDefs, and if the parent value was never rematerialized the live range will be the same. llvm-svn: 126894
* This method belonged in VirtRegMap.Jakob Stoklund Olesen2011-02-191-4/+0
| | | | llvm-svn: 126002
* Use VirtRegMap's Virt2SplitMap to keep track of the original live range ↵Jakob Stoklund Olesen2011-02-181-0/+4
| | | | | | | | before splitting. All new virtual registers created for spilling or splitting point back to their original. llvm-svn: 125980
* Reapply this.Eric Christopher2011-02-031-0/+1
| | | | llvm-svn: 124779
* Temporarily revert 124765 in an attempt to find the cycle breaking bootstrap.Eric Christopher2011-02-031-1/+0
| | | | llvm-svn: 124778
* Defer SplitKit value mapping until all defs are available.Jakob Stoklund Olesen2011-02-031-0/+1
| | | | | | | | | | | | | | | | | | | The greedy register allocator revealed some problems with the value mapping in SplitKit. We would sometimes start mapping values before all defs were known, and that could change a value from a simple 1-1 mapping to a multi-def mapping that requires ssa update. The new approach collects all defs and register assignments first without filling in any live intervals. Only when finish() is called, do we compute liveness and mapped values. At this time we know with certainty which values map to multiple values in a split range. This also has the advantage that we can compute live ranges based on the remaining uses after rematerializing at split points. The current implementation has many opportunities for compile time optimization. llvm-svn: 124765
* Teach the inline spiller to attempt folding a load instruction into its singleJakob Stoklund Olesen2010-12-181-0/+6
| | | | | | | | | | | | | | | | | | use before rematerializing the load. This allows us to produce: addps LCPI0_1(%rip), %xmm2 Instead of: movaps LCPI0_1(%rip), %xmm3 addps %xmm3, %xmm2 Saving a register and an instruction. The standard spiller already knows how to do this. llvm-svn: 122133
* Simplify the LiveRangeEdit::canRematerializeAt() interface a bit.Jakob Stoklund Olesen2010-11-101-5/+5
| | | | llvm-svn: 118661
* Don't assign new registers created during a split to the same stack slot, butJakob Stoklund Olesen2010-11-011-4/+0
| | | | | | give them individual stack slots once the are actually spilled. llvm-svn: 117945
* Fix sign error.Jakob Stoklund Olesen2010-10-291-1/+1
| | | | llvm-svn: 117677
* After splitting, compute connected components of all new registers, not just forJakob Stoklund Olesen2010-10-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the remainder register. Example: bb0: x = 1 bb1: use(x) ... x = 2 jump bb1 When x is isolated in bb1, the inner part breaks into two components, x1 and x2: bb0: x0 = 1 bb1: x1 = x0 use(x1) ... x2 = 2 x0 = x2 jump bb1 llvm-svn: 117408
* Move some of the InlineSpiller rematerialization code into LiveRangeEdit.Jakob Stoklund Olesen2010-10-201-5/+60
| | | | llvm-svn: 116951
* Move stack slot assignments into LiveRangeEdit.Jakob Stoklund Olesen2010-10-151-1/+6
| | | | | | | | | | All registers created during splitting or spilling are assigned to the same stack slot as the parent register. When splitting or rematting, we may not spill at all. In that case the stack slot is still assigned, but it will be dead. llvm-svn: 116546
* Create a new LiveRangeEdit class to keep track of the new registers created whenJakob Stoklund Olesen2010-10-141-0/+70
splitting or spillling, and to help with rematerialization. Use LiveRangeEdit in InlineSpiller and SplitKit. This will eventually make it possible to share remat code between InlineSpiller and SplitKit. llvm-svn: 116543
OpenPOWER on IntegriCloud