src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.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/LinearScanResolveDataFlowPhase.java
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java
Print this page
*** 24,34 ****
import java.util.ArrayList;
import java.util.BitSet;
import org.graalvm.compiler.core.common.cfg.AbstractBlockBase;
! import org.graalvm.compiler.debug.Debug;
import org.graalvm.compiler.debug.Indent;
import org.graalvm.compiler.lir.LIRInstruction;
import org.graalvm.compiler.lir.StandardOp;
import org.graalvm.compiler.lir.gen.LIRGenerationResult;
import org.graalvm.compiler.lir.phases.AllocationPhase.AllocationContext;
--- 24,34 ----
import java.util.ArrayList;
import java.util.BitSet;
import org.graalvm.compiler.core.common.cfg.AbstractBlockBase;
! import org.graalvm.compiler.debug.DebugContext;
import org.graalvm.compiler.debug.Indent;
import org.graalvm.compiler.lir.LIRInstruction;
import org.graalvm.compiler.lir.StandardOp;
import org.graalvm.compiler.lir.gen.LIRGenerationResult;
import org.graalvm.compiler.lir.phases.AllocationPhase.AllocationContext;
*** 79,91 ****
}
}
}
void resolveFindInsertPos(AbstractBlockBase<?> fromBlock, AbstractBlockBase<?> toBlock, MoveResolver moveResolver) {
if (fromBlock.getSuccessorCount() <= 1) {
! if (Debug.isLogEnabled()) {
! Debug.log("inserting moves at end of fromBlock B%d", fromBlock.getId());
}
ArrayList<LIRInstruction> instructions = allocator.getLIR().getLIRforBlock(fromBlock);
LIRInstruction instr = instructions.get(instructions.size() - 1);
if (instr instanceof StandardOp.JumpOp) {
--- 79,92 ----
}
}
}
void resolveFindInsertPos(AbstractBlockBase<?> fromBlock, AbstractBlockBase<?> toBlock, MoveResolver moveResolver) {
+ DebugContext debug = allocator.getDebug();
if (fromBlock.getSuccessorCount() <= 1) {
! if (debug.isLogEnabled()) {
! debug.log("inserting moves at end of fromBlock B%d", fromBlock.getId());
}
ArrayList<LIRInstruction> instructions = allocator.getLIR().getLIRforBlock(fromBlock);
LIRInstruction instr = instructions.get(instructions.size() - 1);
if (instr instanceof StandardOp.JumpOp) {
*** 94,105 ****
} else {
moveResolver.setInsertPosition(instructions, instructions.size());
}
} else {
! if (Debug.isLogEnabled()) {
! Debug.log("inserting moves at beginning of toBlock B%d", toBlock.getId());
}
if (allocator.detailedAsserts) {
assert allocator.getLIR().getLIRforBlock(fromBlock).get(0) instanceof StandardOp.LabelOp : "block does not start with a label";
--- 95,106 ----
} else {
moveResolver.setInsertPosition(instructions, instructions.size());
}
} else {
! if (debug.isLogEnabled()) {
! debug.log("inserting moves at beginning of toBlock B%d", toBlock.getId());
}
if (allocator.detailedAsserts) {
assert allocator.getLIR().getLIRforBlock(fromBlock).get(0) instanceof StandardOp.LabelOp : "block does not start with a label";
*** 121,131 ****
* Inserts necessary moves (spilling or reloading) at edges between blocks for intervals that
* have been split.
*/
@SuppressWarnings("try")
protected void resolveDataFlow() {
! try (Indent indent = Debug.logAndIndent("resolve data flow")) {
MoveResolver moveResolver = allocator.createMoveResolver();
BitSet blockCompleted = new BitSet(allocator.blockCount());
optimizeEmptyBlocks(moveResolver, blockCompleted);
--- 122,132 ----
* Inserts necessary moves (spilling or reloading) at edges between blocks for intervals that
* have been split.
*/
@SuppressWarnings("try")
protected void resolveDataFlow() {
! try (Indent indent = allocator.getDebug().logAndIndent("resolve data flow")) {
MoveResolver moveResolver = allocator.createMoveResolver();
BitSet blockCompleted = new BitSet(allocator.blockCount());
optimizeEmptyBlocks(moveResolver, blockCompleted);
*** 149,160 ****
AbstractBlockBase<?> pred = block.getPredecessors()[0];
AbstractBlockBase<?> sux = block.getSuccessors()[0];
// prevent optimization of two consecutive blocks
if (!blockCompleted.get(pred.getLinearScanNumber()) && !blockCompleted.get(sux.getLinearScanNumber())) {
! if (Debug.isLogEnabled()) {
! Debug.log(" optimizing empty block B%d (pred: B%d, sux: B%d)", block.getId(), pred.getId(), sux.getId());
}
blockCompleted.set(block.getLinearScanNumber());
/*
--- 150,162 ----
AbstractBlockBase<?> pred = block.getPredecessors()[0];
AbstractBlockBase<?> sux = block.getSuccessors()[0];
// prevent optimization of two consecutive blocks
if (!blockCompleted.get(pred.getLinearScanNumber()) && !blockCompleted.get(sux.getLinearScanNumber())) {
! DebugContext debug = allocator.getDebug();
! if (debug.isLogEnabled()) {
! debug.log(" optimizing empty block B%d (pred: B%d, sux: B%d)", block.getId(), pred.getId(), sux.getId());
}
blockCompleted.set(block.getLinearScanNumber());
/*
*** 184,195 ****
/*
* Check for duplicate edges between the same blocks (can happen with switch
* blocks).
*/
if (!alreadyResolved.get(toBlock.getLinearScanNumber())) {
! if (Debug.isLogEnabled()) {
! Debug.log("processing edge between B%d and B%d", fromBlock.getId(), toBlock.getId());
}
alreadyResolved.set(toBlock.getLinearScanNumber());
// collect all intervals that have been split between
--- 186,198 ----
/*
* Check for duplicate edges between the same blocks (can happen with switch
* blocks).
*/
if (!alreadyResolved.get(toBlock.getLinearScanNumber())) {
! DebugContext debug = allocator.getDebug();
! if (debug.isLogEnabled()) {
! debug.log("processing edge between B%d and B%d", fromBlock.getId(), toBlock.getId());
}
alreadyResolved.set(toBlock.getLinearScanNumber());
// collect all intervals that have been split between
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File