summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/InlineSpiller.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Dead code elimination may separate the live interval into multiple connected ↵Jakob Stoklund Olesen2011-03-171-2/+2
| | | | | | | | | 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
* Trace back through sibling copies to hoist spills and find rematerializable ↵Jakob Stoklund Olesen2011-03-151-10/+208
| | | | | | | | | | | | | defs. After live range splitting, an original value may be available in multiple registers. Tracing back through the registers containing the same value, find the best place to insert a spill, determine if the value has already been spilled, or discover a reaching def that may be rematerialized. This is only the analysis part. The information is not used for anything yet. llvm-svn: 127698
* Rename members to match LLVM naming conventions more closely.Jakob Stoklund Olesen2011-03-141-111/+109
| | | | | | | | Remove the unused reserved_ bit vector, no functional change intended. This doesn't break 'svn blame', this file really is all my fault. llvm-svn: 127607
* Tell the register allocator about new unused virtual registers.Jakob Stoklund Olesen2011-03-131-1/+2
| | | | | | | This allows the allocator to free any resources used by the virtual register, including physical register assignments. llvm-svn: 127560
* Include snippets in the live stack interval.Jakob Stoklund Olesen2011-03-121-1/+3
| | | | llvm-svn: 127530
* Spill multiple registers at once.Jakob Stoklund Olesen2011-03-121-48/+203
| | | | | | | | | | | Live range splitting can create a number of small live ranges containing only a single real use. Spill these small live ranges along with the large range they are connected to with copies. This enables memory operand folding and maximizes the spill to fill distance. Work in progress with known bugs. llvm-svn: 127529
* Change the Spiller interface to take a LiveRangeEdit reference.Jakob Stoklund Olesen2011-03-101-19/+0
| | | | | | | This makes it possible to register delegates and get callbacks when the spiller edits live ranges. llvm-svn: 127389
* Make SpillIs an optional pointer. Avoid creating a bunch of temporary ↵Jakob Stoklund Olesen2011-03-101-3/+3
| | | | | | SmallVectors. llvm-svn: 127388
* Add a LiveRangeEdit::Delegate protocol.Jakob Stoklund Olesen2011-03-091-1/+1
| | | | | | | This will we used for keeping register allocator data structures up to date while LiveRangeEdit is trimming live intervals. llvm-svn: 127300
* Make the UselessRegs argument optional in the LiveRangeEdit constructor.Jakob Stoklund Olesen2011-03-071-1/+1
| | | | llvm-svn: 127181
* Use the same spill slot for all live ranges that descend form the same originalJakob Stoklund Olesen2011-02-241-4/+13
| | | | | | | | | register. This avoids some silly stack slot shuffling when both sides of a copy get spilled. llvm-svn: 126353
* 80 Col.Jakob Stoklund Olesen2011-02-221-2/+1
| | | | llvm-svn: 126258
* Set an allocation hint when rematting before a COPY.Jakob Stoklund Olesen2011-02-091-0/+4
| | | | | | This almost guarantees that the COPY will be coalesced. llvm-svn: 125140
* Avoid folding a load instruction into an instruction that redefines the ↵Jakob Stoklund Olesen2011-02-081-1/+5
| | | | | | | | register. The target hook doesn't know how to do that. (Neither do I). llvm-svn: 125108
* Teach TargetRegisterInfo how to cram stack slot indexes in with the virtual andJakob Stoklund Olesen2011-01-091-1/+2
| | | | | | | | | | | | | physical register numbers. This makes the hack used in LiveInterval official, and lets LiveInterval be oblivious of stack slots. The isPhysicalRegister() and isVirtualRegister() predicates don't know about this, so when a variable may contain a stack slot, isStackSlot() should always be tested first. llvm-svn: 123128
* 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
OpenPOWER on IntegriCloud