8285558: IGV: scheduling crashes on control-unreachable CFG nodes

Reviewed-by: kvn, chagedorn
This commit is contained in:
Roberto Castañeda Lozano 2022-05-31 06:59:49 +00:00
parent 8a9aeff18c
commit 8f59422d35

View File

@ -53,6 +53,7 @@ public class ServerCompilerScheduler implements Scheduler {
public static final String WARNING_NOT_MARKED_WITH_BLOCK_START = "Region not marked with is_block_start";
public static final String WARNING_CFG_AND_INPUT_TO_PHI = "CFG node is a phi input";
public static final String WARNING_PHI_NON_DOMINATING_INPUTS = "Phi input that does not dominate the phi's input block";
public static final String WARNING_CONTROL_UNREACHABLE_CFG = "Control-unreachable CFG node";
public InputNode inputNode;
public Set<Node> succs = new HashSet<>();
@ -327,20 +328,6 @@ public class ServerCompilerScheduler implements Scheduler {
schedulePinned();
buildDominators();
scheduleLatest();
InputBlock noBlock = null;
for (InputNode n : graph.getNodes()) {
if (graph.getBlock(n) == null) {
if (noBlock == null) {
noBlock = graph.addArtificialBlock();
blocks.add(noBlock);
}
graph.setBlock(n, noBlock);
}
assert graph.getBlock(n) != null;
}
scheduleLocal();
check();
reportWarnings();
@ -632,6 +619,12 @@ public class ServerCompilerScheduler implements Scheduler {
block = controlSuccs.get(ctrlIn).get(0).block;
}
}
if (block == null) {
// This can happen for blockless CFG nodes that are not
// control-reachable from the root even after connecting orphans
// and widows (e.g. in disconnected control cycles).
continue;
}
n.block = block;
block.addNode(n.inputNode.getId());
}
@ -890,6 +883,9 @@ public class ServerCompilerScheduler implements Scheduler {
if (isRegion(n) && !n.isBlockStart) {
n.addWarning(Node.WARNING_NOT_MARKED_WITH_BLOCK_START);
}
if (n.isCFG && n.block == null) {
n.addWarning(Node.WARNING_CONTROL_UNREACHABLE_CFG);
}
if (!isPhi(n)) {
continue;
}