| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
When the greedy register allocator is splitting multiple global live ranges, it
tends to look at the same interference data many times. The InterferenceCache
class caches queries for unaltered LiveIntervalUnions.
llvm-svn: 128764
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
The spill weight is not recomputed for an unspillable register - it stays infinite.
llvm-svn: 128490
|
|
|
|
|
|
|
|
|
| |
The reassignment phase was able to move interference with a higher spill weight,
but it didn't happen very often and it was fairly expensive.
The existing interference eviction picks up the slack.
llvm-svn: 128397
|
|
|
|
| |
llvm-svn: 127959
|
|
|
|
|
|
| |
The register allocator needs to adjust its live interval unions when that happens.
llvm-svn: 127774
|
|
|
|
| |
llvm-svn: 127771
|
|
|
|
|
|
|
| |
This allows the allocator to free any resources used by the virtual register,
including physical register assignments.
llvm-svn: 127560
|
|
|
|
|
|
|
| |
This makes it possible to register delegates and get callbacks when the spiller
edits live ranges.
llvm-svn: 127389
|
|
|
|
|
|
| |
SmallVectors.
llvm-svn: 127388
|
|
|
|
|
|
|
| |
This will we used for keeping register allocator data structures up to date
while LiveRangeEdit is trimming live intervals.
llvm-svn: 127300
|
|
|
|
| |
llvm-svn: 127181
|
|
|
|
|
|
|
| |
The global cost is the sum of block frequencies for spill code that must be
inserted because preferences weren't met.
llvm-svn: 127062
|
|
|
|
|
|
|
|
|
|
|
| |
pattern.
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
|
|
|
|
| |
llvm-svn: 127040
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 127006
|
|
|
|
| |
llvm-svn: 126975
|
|
|
|
|
|
|
|
|
| |
time.
This speeds up the greedy register allocator by 15%.
DenseMap is not as fast as one might hope.
llvm-svn: 126921
|
|
|
|
|
|
| |
multiple splits.
llvm-svn: 126912
|
|
|
|
|
|
|
| |
This is a waste of time since we already know how to evict all interferences
which is a better approach anyway.
llvm-svn: 126798
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when revisiting.
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
|
|
|
|
| |
llvm-svn: 126463
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
new ranges.
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
|
|
|
|
| |
llvm-svn: 126277
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
allocated first.
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
terminate.
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
|
|
|
|
| |
llvm-svn: 126005
|
|
|
|
| |
llvm-svn: 126001
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 125789
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 125238
|
|
|
|
|
|
| |
No functional changes intended.
llvm-svn: 125231
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 125137
|
|
|
|
|
|
|
| |
The last split point can be anywhere in the block, so it interferes with the
strictly monotonic requirements of advanceTo().
llvm-svn: 125132
|
|
|
|
|
|
| |
instruction in a basic block.
llvm-svn: 125116
|
|
|
|
|
|
|
|
|
| |
allocation.
This is a lot easier than trying to get kill flags right during live range
splitting and rematerialization.
llvm-svn: 125113
|
|
|
|
| |
llvm-svn: 125109
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
are live.
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
|
|
|
|
|
|
| |
If the interference overlaps the instruction, we cannot separate it.
llvm-svn: 124918
|
|
|
|
|
|
|
| |
If these inequalities don't hold, we are creating a live range split that won't
allocate.
llvm-svn: 124917
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
blocks.
llvm-svn: 124815
|
|
|
|
|
|
|
| |
These end points come from the inserted copies, and can be passed directly to
useIntv. This simplifies the coloring code.
llvm-svn: 124799
|