- Mar 05, 2011
-
-
Jakob Stoklund Olesen authored
This simplifies the code and makes it faster too. The interference patterns are saved for each candidate register. It will be reused for actually executing the split. Work in progress. llvm-svn: 127054
-
- Mar 04, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 127040
-
Jakob Stoklund Olesen authored
It gives better results. Sometimes, a live range can be large and still have high spill weight. Such a range should not be spilled. llvm-svn: 127036
-
Jakob Stoklund Olesen authored
llvm-svn: 127006
-
Jakob Stoklund Olesen authored
llvm-svn: 126975
-
- Mar 03, 2011
-
-
Jakob Stoklund Olesen authored
This speeds up the greedy register allocator by 15%. DenseMap is not as fast as one might hope. llvm-svn: 126921
-
Jakob Stoklund Olesen authored
llvm-svn: 126912
-
- Mar 02, 2011
-
-
Jakob Stoklund Olesen authored
This is a waste of time since we already know how to evict all interferences which is a better approach anyway. llvm-svn: 126798
-
- Mar 01, 2011
-
-
Jakob Stoklund Olesen authored
This effectively disables the 'turbo' functionality of the greedy register allocator where all new live ranges created by splitting would be reconsidered as if they were originals. There are two reasons for doing this, 1. It guarantees that the algorithm terminates. Early versions were prone to infinite looping in certain corner cases. 2. It is a 2x speedup. We can skip a lot of unnecessary interference checks that won't lead to good splitting anyway. The problem is that region splitting only gets one shot, so it should probably be changed to target multiple physical registers at once. Local live range splitting is still 'turbo' enabled. It only accounts for a small fraction of compile time, so it is probably not necessary to do anything about that. llvm-svn: 126781
-
- Feb 25, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 126463
-
Jakob Stoklund Olesen authored
New live ranges are assigned in long -> short order, but live ranges that have been evicted at least once are deferred and assigned in short -> long order. Also disable splitting and spilling for live ranges seen for the first time. The intention is to create a realistic interference pattern from the heavy live ranges before starting splitting and spilling around it. llvm-svn: 126451
-
- Feb 23, 2011
-
-
Jakob Stoklund Olesen authored
When a large live range is evicted, it will usually be split when it comes around again. By deferring evicted live ranges, the splitting happens at a time when the interference pattern is more realistic. This prevents repeated splitting and evictions. llvm-svn: 126282
-
Jakob Stoklund Olesen authored
llvm-svn: 126277
-
Jakob Stoklund Olesen authored
Use interval sizes instead of spill weights to determine if it is legal to evict interference. A smaller interval can evict interference if all interfering live ranges are larger. Allow multiple interferences to be evicted as along as they are all larger than the live range being allocated. Spill weights are still used to select the preferred eviction candidate. llvm-svn: 126276
-
Jakob Stoklund Olesen authored
This is based on the observation that long live ranges are more difficult to allocate, so there is a better chance of solving the puzzle by handling the big pieces first. The allocator will evict and split long alive ranges when they get in the way. RABasic is still using spill weights for its priority queue, so the interface to the queue has been virtualized. llvm-svn: 126259
-
- Feb 22, 2011
-
-
Jakob Stoklund Olesen authored
An original endpoint is an instruction that killed or defined the original live range before any live ranges were split. When splitting global live ranges, avoid creating local live ranges without any original endpoints. We may still create global live ranges without original endpoints, but such a range won't be split again, and live range splitting still terminates. llvm-svn: 126151
-
- Feb 19, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 126005
-
Jakob Stoklund Olesen authored
llvm-svn: 126001
-
- Feb 18, 2011
-
-
Jakob Stoklund Olesen authored
The rewriter works almost identically to -rewriter=trivial, except it also eliminates any identity copies. This makes the new register allocators independent of VirtRegRewriter.cpp which will be going away at the same time as RegAllocLinearScan. llvm-svn: 125967
-
- Feb 17, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 125789
-
Jakob Stoklund Olesen authored
A local live range is live in a single basic block. If such a range fails to allocate, try to find a sub-range that would get a larger spill weight than its interference. llvm-svn: 125764
-
- Feb 10, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 125238
-
- Feb 09, 2011
-
-
Jakob Stoklund Olesen authored
No functional changes intended. llvm-svn: 125231
-
Jakob Stoklund Olesen authored
Registers are not allocated strictly in spill weight order when live range splitting and spilling has created new shorter intervals with higher spill weights. When one of the new heavy intervals conflicts with a single lighter interval, simply evict the old interval instead of trying to split the heavy one. The lighter interval is a better candidate for splitting, it has a smaller use density. llvm-svn: 125151
-
Jakob Stoklund Olesen authored
llvm-svn: 125137
-
Jakob Stoklund Olesen authored
The last split point can be anywhere in the block, so it interferes with the strictly monotonic requirements of advanceTo(). llvm-svn: 125132
-
- Feb 08, 2011
-
-
Jakob Stoklund Olesen authored
instruction in a basic block. llvm-svn: 125116
-
Jakob Stoklund Olesen authored
This is a lot easier than trying to get kill flags right during live range splitting and rematerialization. llvm-svn: 125113
-
Jakob Stoklund Olesen authored
llvm-svn: 125109
-
Jakob Stoklund Olesen authored
If a live range is used by a terminator instruction, and that live range needs to leave the block on the stack or in a different register, it can be necessary to have both sides of the split live at the terminator instruction. Example: %vreg2 = COPY %vreg1 JMP %vreg1 Becomes after spilling %vreg2: SPILL %vreg1 JMP %vreg1 The spill doesn't kill the register as is normally the case. llvm-svn: 125102
-
- Feb 05, 2011
-
-
Jakob Stoklund Olesen authored
If the interference overlaps the instruction, we cannot separate it. llvm-svn: 124918
-
Jakob Stoklund Olesen authored
If these inequalities don't hold, we are creating a live range split that won't allocate. llvm-svn: 124917
-
- Feb 04, 2011
-
-
Jakob Stoklund Olesen authored
If interference reaches the last split point, it is effectively live out and should be marked as 'MustSpill'. This can make a difference when the terminator uses a register. There is no way that register can be reused in the outgoing CFG bundle, even if it isn't live out. llvm-svn: 124900
-
Jakob Stoklund Olesen authored
We should not be attempting a region split if it won't lead to at least one directly allocatable interval. That could cause infinite splitting loops. llvm-svn: 124893
-
Jakob Stoklund Olesen authored
When the live range is live through a block that doesn't use the register, but that has interference, region splitting wants to split at the top and bottom of the basic block. llvm-svn: 124839
-
- Feb 03, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 124815
-
Jakob Stoklund Olesen authored
These end points come from the inserted copies, and can be passed directly to useIntv. This simplifies the coloring code. llvm-svn: 124799
-
Eric Christopher authored
llvm-svn: 124779
-
Eric Christopher authored
llvm-svn: 124778
-
Jakob Stoklund Olesen authored
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
-