summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveRangeEdit.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use MRI::isConstantPhysReg() to check remat feasibility.Jakob Stoklund Olesen2012-06-221-4/+8
| | | | | | | Don't depend on LiveIntervals::hasInterval() to determine if a physreg is reserved and constant. llvm-svn: 159013
* Only erase virtregs with no uses left.Jakob Stoklund Olesen2012-05-221-4/+15
| | | | | | | | | Also make sure registers aren't erased twice if the dead def mentions the register twice. This fixes PR12911. llvm-svn: 157254
* Fix 12892.Jakob Stoklund Olesen2012-05-191-0/+4
| | | | | | | | | | | | Dead code elimination during coalescing could cause a virtual register to be split into connected components. The following rewriting would be confused about the already joined copies present in the code, but without a corresponding value number in the live range. Erase all joined copies instantly when joining intervals such that the MI and LiveInterval representations are always in sync. llvm-svn: 157135
* Allow LiveRangeEdit to be created with a NULL parent.Jakob Stoklund Olesen2012-05-191-2/+2
| | | | | | The dead code elimination with callbacks is still useful. llvm-svn: 157100
* Modernize naming convention for class members.Jakob Stoklund Olesen2012-05-181-20/+20
| | | | | | No functional change. llvm-svn: 157079
* Removed one last bad continue statement meant to be removed in r153914.Pete Cooper2012-04-031-1/+0
| | | | llvm-svn: 153975
* Fixes to r153903. Added missing explanation of behaviour when the ↵Pete Cooper2012-04-031-5/+5
| | | | | | VirtRegMap is NULL. Also changed it in this case to just avoid updating the map, but live ranges or intervals will still get updated and created llvm-svn: 153914
* Moved LiveRangeEdit.h so that it can be called from other parts of the ↵Pete Cooper2012-04-021-1/+1
| | | | | | backend, not just libCodeGen llvm-svn: 153906
* Refactored the LiveRangeEdit interface so that MachineFunction, ↵Pete Cooper2012-04-021-46/+28
| | | | | | 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-5/+0
| | | | | | | | methods are no longer needed now that LinearScan has gone away. (Contains tweaks trivialSpillEverywhere to enable the removal of getNewVRegs). llvm-svn: 151658
* Tidy up.Jim Grosbach2012-02-171-1/+1
| | | | llvm-svn: 150820
* Unweaken vtables as per ↵David Blaikie2011-12-201-0/+2
| | | | | | 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/+17
| | | | | | | | 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
* Add bundle aware API for querying instruction properties and switch the codeEvan Cheng2011-12-071-2/+2
| | | | | | | | | | | | | | generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. llvm-svn: 146026
* Rename SlotIndexes to match how they are used.Jakob Stoklund Olesen2011-11-131-4/+4
| | | | | | | | | | | | | | | | | | | | The old naming scheme (load/use/def/store) can be traced back to an old linear scan article, but the names don't match how slots are actually used. The load and store slots are not needed after the deferred spill code insertion framework was deleted. The use and def slots don't make any sense because we are using half-open intervals as is customary in C code, but the names suggest closed intervals. In reality, these slots were used to distinguish early-clobber defs from normal defs. The new naming scheme also has 4 slots, but the names match how the slots are really used. This is a purely mechanical renaming, but some of the code makes a lot more sense now. llvm-svn: 144503
* Move CalculateRegClass to MRI::recomputeRegClass.Jakob Stoklund Olesen2011-08-091-1/+4
| | | | | | | | This function doesn't have anything to do with spill weights, and MRI already has functions for manipulating the register class of a virtual register. llvm-svn: 137123
* Fix PR10277.Jakob Stoklund Olesen2011-07-051-0/+6
| | | | | | | | | | | | | | | Remat during spilling triggers dead code elimination. If a phi-def becomes unused, that may also cause live ranges to split into separate connected components. This type of splitting is different from normal live range splitting. In particular, there may not be a common original interval. When the split range is its own original, make sure that the new siblings are also their own originals. The range being split cannot be used as an original since it doesn't cover the new siblings. llvm-svn: 134413
* Add some statistics to the splitting and spilling frameworks.Jakob Stoklund Olesen2011-05-051-0/+8
| | | | llvm-svn: 130931
* Minimize the slot indexes spanned by register ranges created when splitting.Jakob Stoklund Olesen2011-05-021-2/+4
| | | | | | | | | | | | | 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-3/+5
| | | | llvm-svn: 129883
* Remember to set flag.Jakob Stoklund Olesen2011-04-151-0/+1
| | | | llvm-svn: 129579
* Don't shrink live ranges after dead code elimination unless it is going to help.Jakob Stoklund Olesen2011-04-111-4/+10
| | | | | | In particular, don't repeatedly recompute the PIC base live range after rematerialization. llvm-svn: 129275
* When dead code elimination removes all but one use, try to fold the single ↵Jakob Stoklund Olesen2011-04-051-0/+50
| | | | | | | | 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-1/+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/+11
| | | | | | The spill weight is not recomputed for an unspillable register - it stays infinite. llvm-svn: 128490
* Remember to use the correct register when rematerializing for snippets.Jakob Stoklund Olesen2011-03-291-0/+1
| | | | llvm-svn: 128469
* Properly enable rematerialization when spilling after live range splitting.Jakob Stoklund Olesen2011-03-291-11/+22
| | | | | | | | 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
* Notify the delegate before removing dead values from a live interval.Jakob Stoklund Olesen2011-03-231-0/+2
| | | | | | The register allocator needs to know when the range shrinks. llvm-svn: 128145
* Dead code elimination may separate the live interval into multiple connected ↵Jakob Stoklund Olesen2011-03-171-12/+25
| | | | | | | | | 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-1/+4
| | | | | | The register allocator needs to adjust its live interval unions when that happens. llvm-svn: 127774
* Erase virtual registers that are unused after DCE.Jakob Stoklund Olesen2011-03-161-4/+12
| | | | llvm-svn: 127773
* Clarify debugging output.Jakob Stoklund Olesen2011-03-161-3/+7
| | | | llvm-svn: 127771
* Tell the register allocator about new unused virtual registers.Jakob Stoklund Olesen2011-03-131-0/+5
| | | | | | | This allows the allocator to free any resources used by the virtual register, including physical register assignments. llvm-svn: 127560
* Add a LiveRangeEdit::Delegate protocol.Jakob Stoklund Olesen2011-03-091-0/+2
| | | | | | | 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/+59
| | | | | | | | 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/+4
| | | | llvm-svn: 127181
* This method belonged in VirtRegMap.Jakob Stoklund Olesen2011-02-191-6/+1
| | | | llvm-svn: 126002
* Use VirtRegMap's Virt2SplitMap to keep track of the original live range ↵Jakob Stoklund Olesen2011-02-181-1/+7
| | | | | | | | before splitting. All new virtual registers created for spilling or splitting point back to their original. llvm-svn: 125980
* Simplify the LiveRangeEdit::canRematerializeAt() interface a bit.Jakob Stoklund Olesen2010-11-101-19/+12
| | | | llvm-svn: 118661
* Don't assign new registers created during a split to the same stack slot, butJakob Stoklund Olesen2010-11-011-9/+0
| | | | | | give them individual stack slots once the are actually spilled. llvm-svn: 117945
* Remember to keep track of rematted values.Jakob Stoklund Olesen2010-10-201-0/+1
| | | | llvm-svn: 116962
* Move some of the InlineSpiller rematerialization code into LiveRangeEdit.Jakob Stoklund Olesen2010-10-201-0/+70
| | | | llvm-svn: 116951
* Move stack slot assignments into LiveRangeEdit.Jakob Stoklund Olesen2010-10-151-0/+9
| | | | | | | | | | 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/+64
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