# HG changeset patch # User Josef Eisl # Date 1402499003 -7200 # Node ID 3324ab9fe71a645aa1670d3d2452ec43b84bed31 # Parent f8ba57019a5d55ab475d6ed2179dd7878afcea9d LSRA spill optimization: iterate all ranges of spill interval. diff -r f8ba57019a5d -r 3324ab9fe71a graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Wed Jun 11 17:02:27 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Wed Jun 11 17:03:23 2014 +0200 @@ -2047,11 +2047,13 @@ int nextOpId; Interval interval; + Range currentRange; public UseBlockIterator(Interval interval) { // the first use position is the begin of the interval nextOpId = interval.from(); this.interval = interval; + this.currentRange = interval.first(); } public AbstractBlock next() { @@ -2064,6 +2066,11 @@ assert from > maxOpId() || isBlockBegin(from) : "nextOpId is not a block begin"; assert from > maxOpId() || blockForId(from).getLinearScanNumber() == block.getLinearScanNumber() + 1 : "nextOpId is not the beginning of the next block"; nextOpId = interval.nextUsage(RegisterPriority.None, from); + if (nextOpId > currentRange.from) { + // jump to next range + nextOpId = currentRange.from; + currentRange = currentRange.next; + } } else { // already at last the last block nextOpId = Integer.MAX_VALUE;