src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java

Print this page

        

*** 28,39 **** import static org.graalvm.compiler.lir.LIRValueUtil.isStackSlotValue; import java.util.ArrayList; import org.graalvm.compiler.core.common.cfg.AbstractBlockBase; ! import org.graalvm.compiler.debug.Debug; ! import org.graalvm.compiler.debug.DebugCounter; import org.graalvm.compiler.lir.LIRInstruction; import org.graalvm.compiler.lir.alloc.lsra.Interval; import org.graalvm.compiler.lir.alloc.lsra.LinearScan; import org.graalvm.compiler.lir.alloc.lsra.LinearScanResolveDataFlowPhase; import org.graalvm.compiler.lir.alloc.lsra.MoveResolver; --- 28,39 ---- import static org.graalvm.compiler.lir.LIRValueUtil.isStackSlotValue; import java.util.ArrayList; import org.graalvm.compiler.core.common.cfg.AbstractBlockBase; ! import org.graalvm.compiler.debug.CounterKey; ! import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.lir.LIRInstruction; import org.graalvm.compiler.lir.alloc.lsra.Interval; import org.graalvm.compiler.lir.alloc.lsra.LinearScan; import org.graalvm.compiler.lir.alloc.lsra.LinearScanResolveDataFlowPhase; import org.graalvm.compiler.lir.alloc.lsra.MoveResolver;
*** 42,53 **** import jdk.vm.ci.meta.Value; class SSALinearScanResolveDataFlowPhase extends LinearScanResolveDataFlowPhase { ! private static final DebugCounter numPhiResolutionMoves = Debug.counter("SSA LSRA[numPhiResolutionMoves]"); ! private static final DebugCounter numStackToStackMoves = Debug.counter("SSA LSRA[numStackToStackMoves]"); SSALinearScanResolveDataFlowPhase(LinearScan allocator) { super(allocator); } --- 42,53 ---- import jdk.vm.ci.meta.Value; class SSALinearScanResolveDataFlowPhase extends LinearScanResolveDataFlowPhase { ! private static final CounterKey numPhiResolutionMoves = DebugContext.counter("SSA LSRA[numPhiResolutionMoves]"); ! private static final CounterKey numStackToStackMoves = DebugContext.counter("SSA LSRA[numStackToStackMoves]"); SSALinearScanResolveDataFlowPhase(LinearScan allocator) { super(allocator); }
*** 70,90 **** @Override public void visit(Value phiIn, Value phiOut) { assert !isRegister(phiOut) : "phiOut is a register: " + phiOut; assert !isRegister(phiIn) : "phiIn is a register: " + phiIn; Interval toInterval = allocator.splitChildAtOpId(allocator.intervalFor(phiIn), toBlockFirstInstructionId, LIRInstruction.OperandMode.DEF); if (isConstantValue(phiOut)) { ! numPhiResolutionMoves.increment(); moveResolver.addMapping(asConstant(phiOut), toInterval); } else { Interval fromInterval = allocator.splitChildAtOpId(allocator.intervalFor(phiOut), phiOutId, LIRInstruction.OperandMode.DEF); if (fromInterval != toInterval && !fromInterval.location().equals(toInterval.location())) { ! numPhiResolutionMoves.increment(); if (!(isStackSlotValue(toInterval.location()) && isStackSlotValue(fromInterval.location()))) { moveResolver.addMapping(fromInterval, toInterval); } else { ! numStackToStackMoves.increment(); moveResolver.addMapping(fromInterval, toInterval); } } } } --- 70,91 ---- @Override public void visit(Value phiIn, Value phiOut) { assert !isRegister(phiOut) : "phiOut is a register: " + phiOut; assert !isRegister(phiIn) : "phiIn is a register: " + phiIn; Interval toInterval = allocator.splitChildAtOpId(allocator.intervalFor(phiIn), toBlockFirstInstructionId, LIRInstruction.OperandMode.DEF); + DebugContext debug = allocator.getDebug(); if (isConstantValue(phiOut)) { ! numPhiResolutionMoves.increment(debug); moveResolver.addMapping(asConstant(phiOut), toInterval); } else { Interval fromInterval = allocator.splitChildAtOpId(allocator.intervalFor(phiOut), phiOutId, LIRInstruction.OperandMode.DEF); if (fromInterval != toInterval && !fromInterval.location().equals(toInterval.location())) { ! numPhiResolutionMoves.increment(debug); if (!(isStackSlotValue(toInterval.location()) && isStackSlotValue(fromInterval.location()))) { moveResolver.addMapping(fromInterval, toInterval); } else { ! numStackToStackMoves.increment(debug); moveResolver.addMapping(fromInterval, toInterval); } } } }
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File