# HG changeset patch # User Josef Eisl # Date 1402490999 -7200 # Node ID f0ac7457252a2c1dea1dcdccb61d4df9939b38b9 # Parent 0abb7a42ef75323393d73249d707dd996cbd4bf9 LSRA spill optimization: use the correct from location for the spill move. diff -r 0abb7a42ef75 -r f0ac7457252a 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 Tue Jun 10 16:43:26 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Wed Jun 11 14:49:59 2014 +0200 @@ -606,7 +606,9 @@ insertionBuffer.init(instructions); } - AllocatableValue fromLocation = interval.location(); + // if we spill in a dominator we need to find the right location + AllocatableValue fromLocation = interval.spillState() == SpillState.SpillInDominator ? interval.getSplitChildAtOpId(opId, OperandMode.DEF, this).location() + : interval.location(); AllocatableValue toLocation = canonicalSpillOpr(interval); assert isRegister(fromLocation) : "from operand must be a register but is: " + fromLocation + " toLocation=" + toLocation + " spillState=" + interval.spillState();