changeset 23127:7d8302d428bd

TraceRA: TraceLinearScanEliminateSpillMovePhase: do not introduce spill moves for intervals that StartInMemory.
author Josef Eisl <josef.eisl@jku.at>
date Tue, 01 Dec 2015 16:15:46 +0100
parents aadd99d250fe
children c8eb711096d2
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java	Tue Dec 01 16:14:17 2015 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java	Tue Dec 01 16:15:46 2015 +0100
@@ -144,19 +144,20 @@
 
                                 while (interval != TraceInterval.EndMarker && interval.spillDefinitionPos() == opId) {
                                     Debug.log("handle %s", interval);
-                                    if (!interval.canMaterialize()) {
-                                        if (!insertionBuffer.initialized()) {
-                                            /*
-                                             * prepare insertion buffer (appended when all
-                                             * instructions in the block are processed)
-                                             */
-                                            insertionBuffer.init(instructions);
-                                        }
+                                    if (!interval.canMaterialize() && interval.spillState() != SpillState.StartInMemory) {
 
                                         AllocatableValue fromLocation = interval.getSplitChildAtOpId(opId, OperandMode.DEF, allocator).location();
                                         AllocatableValue toLocation = TraceLinearScan.canonicalSpillOpr(interval);
                                         if (!fromLocation.equals(toLocation)) {
 
+                                            if (!insertionBuffer.initialized()) {
+                                                /*
+                                                 * prepare insertion buffer (appended when all
+                                                 * instructions in the block are processed)
+                                                 */
+                                                insertionBuffer.init(instructions);
+                                            }
+
                                             assert isRegister(fromLocation) : "from operand must be a register but is: " + fromLocation + " toLocation=" + toLocation + " spillState=" +
                                                             interval.spillState();
                                             assert isStackSlotValue(toLocation) : "to operand must be a stack slot";