summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/InlineSpiller.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Apparently, operandices is not a word.Jakob Stoklund Olesen2010-12-181-1/+1
| | | | llvm-svn: 122135
* Teach the inline spiller to attempt folding a load instruction into its singleJakob Stoklund Olesen2010-12-181-5/+21
| | | | | | | | | | | | | | | | | | 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
* Pass a Banner argument to the machine code verifier both fromJakob Stoklund Olesen2010-12-181-2/+2
| | | | | | | | createMachineVerifierPass and MachineFunction::verify. The banner is printed before the machine code dump, just like the printer pass. llvm-svn: 122113
* Rip out live range splitting support from the inline spiller.Jakob Stoklund Olesen2010-12-101-56/+1
| | | | | | | | The spiller should only spill. The register allocator will drive live range splitting, it has the needed information about register pressure and interferences. llvm-svn: 121590
* When spilling a register defined by an early clobber, make sure that the newJakob Stoklund Olesen2010-11-151-0/+6
| | | | | | | | | | | | | live ranges for the spill register are also defined at the use slot instead of the normal def slot. This fixes PR8612 for the inline spiller. A use was being allocated to the same register as a spilled early clobber def. This problem exists in all the spillers. A fix for the standard spiller is forthcoming. llvm-svn: 119182
* Hook up AliasAnalysis in InlineSpiller. This is used for rematerializingJakob Stoklund Olesen2010-11-101-1/+4
| | | | | | constant loads. llvm-svn: 118741
* RABasic is nearly functionally complete. There are a few remainingAndrew Trick2010-11-101-2/+2
| | | | | | | | | benchmarks hitting an assertion. Adds LiveIntervalUnion::collectInterferingVRegs. Fixes "late spilling" by checking for any unspillable live vregs among all physReg aliases. llvm-svn: 118701
* Simplify the LiveRangeEdit::canRematerializeAt() interface a bit.Jakob Stoklund Olesen2010-11-101-3/+2
| | | | llvm-svn: 118661
* Disable fancy splitting during spilling unless -extra-spiller-splits is given.Jakob Stoklund Olesen2010-11-041-8/+18
| | | | | | | | This way, InlineSpiller does the same amount of splitting as the standard spiller. Splitting should really be guided by the register allocator, and doesn't belong in the spiller at all. llvm-svn: 118216
* Tag debug output as regallocJakob Stoklund Olesen2010-11-031-1/+1
| | | | llvm-svn: 118193
* Don't assign new registers created during a split to the same stack slot, butJakob Stoklund Olesen2010-11-011-3/+3
| | | | | | give them individual stack slots once the are actually spilled. llvm-svn: 117945
* Print out register class of spilled register.Jakob Stoklund Olesen2010-10-301-2/+4
| | | | llvm-svn: 117761
* Run a verification pass before any splitting to better distribute blame.Jakob Stoklund Olesen2010-10-291-0/+2
| | | | llvm-svn: 117629
* Make MachineDominators available for SplitEditor. We are going to need it forJakob Stoklund Olesen2010-10-281-3/+6
| | | | | | | | | proper SSA updating. This doesn't cause MachineDominators to be recomputed since we are already requiring MachineLoopInfo which uses dominators as well. llvm-svn: 117598
* Add a temporary command line option to verify machine code after each spill orJakob Stoklund Olesen2010-10-281-0/+6
| | | | | | split. llvm-svn: 117597
* InlineSpiller can also update LiveStacks.Jakob Stoklund Olesen2010-10-261-0/+9
| | | | llvm-svn: 117338
* Move some of the InlineSpiller rematerialization code into LiveRangeEdit.Jakob Stoklund Olesen2010-10-201-36/+18
| | | | llvm-svn: 116951
* Move stack slot assignments into LiveRangeEdit.Jakob Stoklund Olesen2010-10-151-3/+1
| | | | | | | | | | 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-80/+45
| | | | | | | | | 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
* Update SplitEditor API to reflect the fact that the original live interval isJakob Stoklund Olesen2010-10-051-12/+10
| | | | | | | | | | never kept after splitting. Keeping the original interval made sense when the split region doesn't modify the register, and the original is spilled. We can get the same effect by detecting reloaded values when spilling around copies. llvm-svn: 115695
* Fixed some tests to avoid LiveIntervals::getInstructionFromIndex(..) ↵Lang Hames2010-09-261-1/+1
| | | | | | overhead where possible. Thanks to Jakob for the suggestions. llvm-svn: 114798
* Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing ↵Lang Hames2010-09-251-7/+5
| | | | | | whether LiveIntervals::getInstructionFromIndex(def) returns NULL. llvm-svn: 114791
* Clean up the Spiller.h interface.Jakob Stoklund Olesen2010-08-131-7/+5
| | | | | | | | | The earliestStart argument is entirely specific to linear scan allocation, and can be easily calculated by RegAllocLinearScan. Replace std::vector with SmallVector. llvm-svn: 111055
* Implement splitting inside a single block.Jakob Stoklund Olesen2010-08-131-4/+9
| | | | | | | | When a live range is contained a single block, we can split it around instruction clusters. The current approach is very primitive, splitting before and after the largest gap between uses. llvm-svn: 111043
* Implement single block splitting.Jakob Stoklund Olesen2010-08-121-0/+9
| | | | | | | | | | Before spilling a live range, we split it into a separate range for each basic block where it is used. That way we only get one reload per basic block if the new smaller ranges can allocate to a register. This type of splitting is already present in the standard spiller. llvm-svn: 110934
* Avoid editing the current live interval during remat.Jakob Stoklund Olesen2010-08-101-3/+3
| | | | | | | | The live interval may be used for a spill slot as well, and that spill slot could be shared by split registers. We cannot shrink it, even if we know the current register won't need the spill slot in that range. llvm-svn: 110721
* Lazily defer duplicating the live interval we are splitting until we know it isJakob Stoklund Olesen2010-08-061-3/+4
| | | | | | | | | | necessary. Sometimes, live range splitting doesn't shrink the current interval, but simply changes some instructions to use a new interval. That makes the original more suitable for spilling. In this case, we don't need to duplicate the original. llvm-svn: 110481
* Keep the MachiuneFunctionPass pointer around. It is useful for verification.Jakob Stoklund Olesen2010-08-061-1/+3
| | | | llvm-svn: 110464
* Coalesce stack slot accesses that arise when spilling both sides of a COPY.Jakob Stoklund Olesen2010-08-041-0/+23
| | | | | | | | | This helps avoid silly code: %R0<def = LOAD <fi#5> STORE <fi#5>, %R0<kill> llvm-svn: 110266
* Checkpoint SplitKit progress.Jakob Stoklund Olesen2010-08-041-2/+5
| | | | | | | We are now at a point where we can split around simple single-entry, single-exit loops, although still with some bugs. llvm-svn: 110257
* Add SplitEditor to SplitKit. This class will be used to edit live intervals andJakob Stoklund Olesen2010-07-261-2/+2
| | | | | | | | rewrite instructions for live range splitting. Still work in progress. llvm-svn: 109469
* Change the createSpiller interface to take a MachineFunctionPass argument.Jakob Stoklund Olesen2010-07-201-13/+16
| | | | | | | | The spillers can pluck the analyses they need from the pass reference. Switch some never-null pointers to references. llvm-svn: 108969
* Beginning SplitKit - utility classes for live range splitting.Jakob Stoklund Olesen2010-07-201-1/+26
| | | | | | | | | This is a work in progress. So far we have some basic loop analysis to help determine where it is useful to split a live range around a loop. The actual loop splitting code from Splitter.cpp is also going to move in here. llvm-svn: 108842
* Spillers may alter MachineLoopInfo when breaking critical edges, so make itJakob Stoklund Olesen2010-07-191-4/+7
| | | | | | non-const. llvm-svn: 108734
* Change TII::foldMemoryOperand API to require the machine instruction to beJakob Stoklund Olesen2010-07-091-3/+2
| | | | | | | | | | | | | | inserted in a MBB, and return an already inserted MI. This target API change is necessary to allow foldMemoryOperand to call storeToStackSlot and loadFromStackSlot when folding a COPY to a stack slot reference in a target independent way. The foldMemoryOperandImpl hook is going to change in the same way, but I'll wait until COPY folding is actually implemented. Most targets only fold copies and won't need to specialize this hook at all. llvm-svn: 107991
* Remove invalid assertJakob Stoklund Olesen2010-07-021-1/+0
| | | | llvm-svn: 107505
* Properly handle debug values during inline spilling.Jakob Stoklund Olesen2010-07-021-13/+32
| | | | llvm-svn: 107503
* Rematerialize as much as possible before inserting spills and reloads.Jakob Stoklund Olesen2010-07-021-60/+179
| | | | | | | | | | This allows us to recognize the common case where all uses could be rematerialized, and no stack slot allocation is necessary. If some values could be fully rematerialized, remove them from the live range before allocating a stack slot for the rest. llvm-svn: 107492
* Add memory operand folding support to InlineSpiller.Jakob Stoklund Olesen2010-07-011-0/+37
| | | | llvm-svn: 107355
* Add support for rematerialization to InlineSpiller.Jakob Stoklund Olesen2010-06-301-31/+128
| | | | llvm-svn: 107351
* Remember to track spill slot uses in VirtRegMap when inserting loads and stores.Jakob Stoklund Olesen2010-06-301-0/+2
| | | | | | | | | LocalRewriter::runOnMachineFunction uses this information to mark dead spill slots. This means that InlineSpiller now also works for functions that spill. llvm-svn: 107302
* Begin implementation of an inline spiller.Jakob Stoklund Olesen2010-06-291-0/+136
InlineSpiller inserts loads and spills immediately instead of deferring to VirtRegMap. This is possible now because SlotIndexes allows instructions to be inserted and renumbered. This is work in progress, and is mostly a copy of TrivialSpiller so far. It works very well for functions that don't require spilling. llvm-svn: 107227
OpenPOWER on IntegriCloud