# HG changeset patch # User Josef Eisl # Date 1448273857 -3600 # Node ID 41dc027f8de7ff75c403fd75ffe6b38e45fbee8e # Parent cc80ff107273fdd3dbefd8482e773e7b69a00568 TraceRA: add hints for moves to fixed registers. diff -r cc80ff107273 -r 41dc027f8de7 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanLifetimeAnalysisPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanLifetimeAnalysisPhase.java Mon Nov 23 09:58:08 2015 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceLinearScanLifetimeAnalysisPhase.java Mon Nov 23 11:17:37 2015 +0100 @@ -330,8 +330,11 @@ op.forEachRegisterHint(targetValue, mode, (registerHint, valueMode, valueFlags) -> { if (TraceLinearScan.isVariableOrRegister(registerHint)) { - AllocatableValue fromValue; - AllocatableValue toValue; + /* + * TODO (je): clean up + */ + final AllocatableValue fromValue; + final AllocatableValue toValue; /* hints always point from def to use */ if (hintAtDef) { fromValue = (AllocatableValue) registerHint; @@ -340,14 +343,21 @@ fromValue = (AllocatableValue) targetValue; toValue = (AllocatableValue) registerHint; } + Debug.log("addRegisterHint %s to %s", fromValue, toValue); + final TraceInterval to; + final IntervalHint from; if (isRegister(toValue)) { - /* fixed register: no need for a hint */ - return null; + if (isRegister(fromValue)) { + // fixed to fixed move + return null; + } + from = getIntervalHint(toValue); + to = allocator.getOrCreateInterval(fromValue); + } else { + to = allocator.getOrCreateInterval(toValue); + from = getIntervalHint(fromValue); } - TraceInterval to = allocator.getOrCreateInterval(toValue); - IntervalHint from = getIntervalHint(fromValue); - to.setLocationHint(from); if (Debug.isLogEnabled()) { Debug.log("operation at opId %d: added hint from interval %s to %s", op.id(), from, to);