When deciding which live ranges to split each live range is given a score based on it's cost and area and other factors like whether it has been spilled before. Once an LRG has been spilled multiple times the score ends up being a large value which washes away the difference between LRGs. This means that when comparing two LRG that have both been spilled multiple times the register allocator will always pick the first one it encounters to spill. Most of the times this work out ok but there are a bunch of spill-split-recycle failures in the full CTW run where the register allocator ends up picking that one or two LRG to spill and doesn't make progress. This is also occassionally happens in _213_javac and the fix for 5032515 causes it to happen all the time. There are many possible fixes but the most straightforward and least perturbing one is to when comparing LRGs is another LRG has the same cost but a larger area and the current one has been spilled multiple times pick the other LRG. Since splitting an LRG reduces its area this should encourage trying different LRGs instead of retrying the same ones. On a full CTW this reduced the number of spill-split-recycle failures from 68 to 2. A separate bug was filed to cover the other 2.
|