aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/InlineSpiller.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111055 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111043 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110934 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110721 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110481 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep the MachiuneFunctionPass pointer around. It is useful for verification.Jakob Stoklund Olesen2010-08-061-1/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110464 91177308-0d34-0410-b5e6-96231b3b80d8
* 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> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110266 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110257 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109469 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108969 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108842 91177308-0d34-0410-b5e6-96231b3b80d8
* Spillers may alter MachineLoopInfo when breaking critical edges, so make itJakob Stoklund Olesen2010-07-191-4/+7
| | | | | | non-const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108734 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107991 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove invalid assertJakob Stoklund Olesen2010-07-021-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107505 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly handle debug values during inline spilling.Jakob Stoklund Olesen2010-07-021-13/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107503 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107492 91177308-0d34-0410-b5e6-96231b3b80d8
* Add memory operand folding support to InlineSpiller.Jakob Stoklund Olesen2010-07-011-0/+37
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107355 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for rematerialization to InlineSpiller.Jakob Stoklund Olesen2010-06-301-31/+128
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107351 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107302 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107227 91177308-0d34-0410-b5e6-96231b3b80d8