Skip to content
Permalink
Browse files
8285558: IGV: scheduling crashes on control-unreachable CFG nodes
Reviewed-by: kvn, chagedorn
  • Loading branch information
robcasloz committed May 31, 2022
1 parent 8a9aeff commit 8f59422d357a00a2270a8f421966977e3979c2fb
Showing 1 changed file with 10 additions and 14 deletions.
@@ -53,6 +53,7 @@ private static class Node {
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 Collection<InputBlock> schedule(InputGraph graph) {
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 void schedulePinned() {
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 void check() {
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;
}

1 comment on commit 8f59422

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 8f59422 May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.