- May 31, 2011
-
-
Jakob Stoklund Olesen authored
When assigned ranges are evicted, they are put in the RS_Evicted stage and are not allowed to evict anything else. That prevents looping automatically. When evicting ranges just to get a cheaper register, use only spill weights to find the possible candidates. Avoid breaking hints for this purpose, it is not worth it. Start implementing more complex eviction heuristics, guarded by the temporary -complex-eviction flag. The initial version permits a heavier range to be evicted if it doesn't have any uses where the evicting range is live. This makes it a good candidate for live ranfge splitting. llvm-svn: 132358
-
- May 30, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 132309
-
- May 29, 2011
-
-
Jakob Stoklund Olesen authored
This commit seems to have broken a darwin 9 tester. llvm-svn: 132299
-
- May 28, 2011
-
-
Jakob Stoklund Olesen authored
Delete the Kill and Def markers in BlockInfo. They are no longer necessary when BlockInfo describes a continuous live range. This only affects the relatively rare kind of basic block where a live range looks like this: |---x o---| Now live range splitting can pretend that it is looking at two blocks: |---x o---| This allows the code to be simplified a bit. llvm-svn: 132245
-
Jakob Stoklund Olesen authored
It is important that this function returns the same number of live blocks as countLiveBlocks(CurLI) because live range splitting uses the number of live blocks to ensure it is making progress. This is in preparation of supporting duplicate UseBlock entries for basic blocks that have a virtual register live-in and live-out, but not live-though. llvm-svn: 132244
-
- May 26, 2011
-
-
Jakob Stoklund Olesen authored
This doesn't change functionality (much), but it allows for a more fine-grained eviction policy. The current policy only compares spill weights, and that is not always the best thing to do. Spill weights are designed to serve linear scan, and they don't consider live range splitting. Add a mechanism so canEvict() can request that a live range be evicted and split/spilled. This is to avoid infinite eviction loops. llvm-svn: 132101
-
- May 10, 2011
-
-
Jakob Stoklund Olesen authored
The previous invalidation missed the alias interference caches. Also add a stats counter for the number of repaired ranges. llvm-svn: 131133
-
- May 06, 2011
-
-
Jakob Stoklund Olesen authored
This can't be just an assertion, users can always write impossible inline assembly. Such an assembly statement should be included in the error message. llvm-svn: 131024
-
Jakob Stoklund Olesen authored
After a virtual register is split, update any debug user variables that resided in the old register. This ensures that the LiveDebugVariables are still correct after register allocation. This may create DBG_VALUE instructions that place a user variable in a register in parts of the function and in a stack slot in other parts. DwarfDebug currently doesn't support that. llvm-svn: 130998
-
- May 03, 2011
-
-
Jakob Stoklund Olesen authored
Register coalescing can sometimes create live ranges that end in the middle of a basic block without any killing instruction. When SplitKit detects this, it will repair the live range by shrinking it to its uses. Live range splitting also needs to know about this. When the range shrinks so much that it becomes allocatable, live range splitting fails because it can't find a good split point. It is paranoid about making progress, so an allocatable range is considered an error. The coalescer should really not be creating these bad live ranges. They appear when coalescing dead copies. llvm-svn: 130787
-
- Apr 30, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 130596
-
- Apr 27, 2011
-
-
Jakob Stoklund Olesen authored
The number of blocks covered by a live range must be strictly decreasing when splitting, otherwise we can't allow repeated splitting. llvm-svn: 130249
-
- Apr 23, 2011
-
-
Jakob Stoklund Olesen authored
Sometimes it is better to split per block, and we missed those cases. llvm-svn: 130025
-
- Apr 21, 2011
-
-
Jakob Stoklund Olesen authored
These intervals are allocatable immediately after splitting, but they may be evicted because of later splitting. This is rare, but when it happens they should be split again. The remainder intervals that cannot be allocated after splitting still move directly to spilling. SplitEditor::finish can optionally provide a mapping from new live intervals back to the original interval indexes returned by openIntv(). Each original interval index can map to multiple new intervals after connected components have been separated. Dead code elimination may also add existing intervals to the list. The reverse mapping allows the SplitEditor client to treat the new intervals differently depending on the split region they came from. llvm-svn: 129925
-
- Apr 20, 2011
-
-
Jakob Stoklund Olesen authored
On the x86-64 and thumb2 targets, some registers are more expensive to encode than others in the same register class. Add a CostPerUse field to the TableGen register description, and make it available from TRI->getCostPerUse. This represents the cost of a REX prefix or a 32-bit instruction encoding required by choosing a high register. Teach the greedy register allocator to prefer cheap registers for busy live ranges (as indicated by spill weight). llvm-svn: 129864
-
- Apr 13, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 129442
-
- Apr 12, 2011
-
-
Jakob Stoklund Olesen authored
Use a Bitvector instead, we didn't need the smaller memory footprint anyway. This makes the greedy register allocator 10% faster. llvm-svn: 129390
-
Jakob Stoklund Olesen authored
This merges the behavior of splitSingleBlocks into splitAroundRegion, so the RS_Region and RS_Block register stages can be coalesced. That means the leftover intervals after region splitting go directly to spilling instead of a second pass of per-block splitting. llvm-svn: 129379
-
- Apr 11, 2011
-
-
Jakob Stoklund Olesen authored
weight limit has been exceeded. llvm-svn: 129305
-
- Apr 09, 2011
-
-
Jakob Stoklund Olesen authored
It is common for large live ranges to have few basic blocks with register uses and many live-through blocks without any uses. This approach grows the Hopfield network incrementally around the use blocks, completely avoiding checking interference for some through blocks. llvm-svn: 129188
-
- Apr 07, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 129079
-
- Apr 06, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 129030
-
Jakob Stoklund Olesen authored
Without any positive bias, there is nothing for the spill placer to to. It will spill everywhere. llvm-svn: 129029
-
Jakob Stoklund Olesen authored
If there are no positive nodes, the algorithm can be aborted early. llvm-svn: 129021
-
Jakob Stoklund Olesen authored
This will allow us to abort the algorithm early if it is determined to be futile. llvm-svn: 129020
-
Jakob Stoklund Olesen authored
llvm-svn: 128986
-
Jakob Stoklund Olesen authored
About 90% of the relevant blocks are live-through without uses, and the only information required about them is their number. This saves memory and enables later optimizations that need to look at only the use-blocks. llvm-svn: 128985
-
- Apr 05, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 128935
-
Jakob Stoklund Olesen authored
llvm-svn: 128875
-
- Apr 04, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 128821
-
- Apr 02, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 128765
-
Jakob Stoklund Olesen authored
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
-
- Mar 30, 2011
-
-
Jakob Stoklund Olesen authored
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
-
- Mar 29, 2011
-
-
Jakob Stoklund Olesen authored
The spill weight is not recomputed for an unspillable register - it stays infinite. llvm-svn: 128490
-
- Mar 28, 2011
-
-
Jakob Stoklund Olesen authored
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
-
- Mar 20, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 127959
-
- Mar 16, 2011
-
-
Jakob Stoklund Olesen authored
The register allocator needs to adjust its live interval unions when that happens. llvm-svn: 127774
-
Jakob Stoklund Olesen authored
llvm-svn: 127771
-
- Mar 13, 2011
-
-
Jakob Stoklund Olesen authored
This allows the allocator to free any resources used by the virtual register, including physical register assignments. llvm-svn: 127560
-
- Mar 10, 2011
-
-
Jakob Stoklund Olesen authored
This makes it possible to register delegates and get callbacks when the spiller edits live ranges. llvm-svn: 127389
-