United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6468040 policy for ties in LRG scores should take area into account
JDK-6468040 : policy for ties in LRG scores should take area into account

Details
Type:
Bug
Submit Date:
2006-09-07
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2006-11-14
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs10 (b03)

Related Reports
Backport:
Backport:

Sub Tasks

Description
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.

                                    

Comments
EVALUATION

see description.
                                     
2006-09-07
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
                                     
2006-09-08



Hardware and Software, Engineered to Work Together