Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -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;
}