changeset 16370:3324ab9fe71a

LSRA spill optimization: iterate all ranges of spill interval.
author Josef Eisl <josef.eisl@jku.at>
date Wed, 11 Jun 2014 17:03:23 +0200
parents f8ba57019a5d
children 3a997f63ddac
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;