JDK-6468040 : policy for ties in LRG scores should take area into account
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2006-09-07
  • Updated: 2010-04-02
  • Resolved: 2006-11-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
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.

SUGGESTED FIX http://analemma.sfbay.sun.com/net/prt-archiver.sfbay/data/archived_workspaces/main/c2_baseline/2006/20060907210319.never.regalloc/workspace/webrevs/webrev-2006.09.07/index.html

EVALUATION see description.