Skip to content

Commit 8fb67ac

Browse files
Daniel Skantzrobcasloz
authored andcommitted
8282053: IGV: refine schedule approximation
Reviewed-by: rcastanedalo, dlunden, dfenacci
1 parent d358f5f commit 8fb67ac

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

src/utils/IdealGraphVisualizer/ServerCompiler/src/main/java/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ private static class Node {
6767
public boolean isBlockProjection;
6868
public boolean isBlockStart;
6969
public boolean isCFG;
70+
public boolean isParm;
71+
public boolean isProj;
7072
public int rank; // Rank for local scheduling priority.
7173

7274
// Empty constructor for creating dummy CFG nodes without associated
@@ -79,6 +81,8 @@ public Node(InputNode n) {
7981
isBlockProjection = (p != null && p.equals("true"));
8082
p = n.getProperties().get("is_block_start");
8183
isBlockStart = (p != null && p.equals("true"));
84+
isParm = isParm(this);
85+
isProj = isProj(this);
8286
computeRank();
8387
}
8488

@@ -464,7 +468,20 @@ private void scheduleLatest() {
464468
Set<Node> unscheduled = new HashSet<>();
465469
for (Node n : this.nodes) {
466470
if (n.block == null && reachable.contains(n) && !n.isCFG) {
467-
unscheduled.add(n);
471+
if (!n.isParm && !n.isProj) {
472+
unscheduled.add(n);
473+
} else {
474+
// Schedule Parm and Proj nodes in same block as parent
475+
Node prev = n.preds.get(0);
476+
InputBlock blk = prev.block;
477+
if (blk != null) {
478+
n.block = blk;
479+
blk.addNode(n.inputNode.getId());
480+
} else {
481+
// Fallback in the case parent has no block
482+
unscheduled.add(n);
483+
}
484+
}
468485
}
469486
}
470487

@@ -779,12 +796,15 @@ public void markCFGNodes() {
779796
if (category.equals("control") || category.equals("mixed")) {
780797
// Example: If, IfTrue, CallStaticJava.
781798
n.isCFG = true;
782-
} else if (n.inputNode.getProperties().get("type").equals("bottom")
783-
&& n.preds.size() > 0 &&
799+
} else if (n.inputNode.getProperties().get("type").equals("bottom") &&
800+
n.preds.size() > 0 &&
801+
n.succs.size() > 0 &&
802+
n.succs.stream().findFirst().get().inputNode.getProperties().get("name") == "Root" &&
784803
n.preds.get(0) != null &&
785804
n.preds.get(0).inputNode.getProperties()
786805
.get("category").equals("control")) {
787806
// Example: Halt, Return, Rethrow.
807+
// The root-as-successor check disallows machine nodes such as prefetchAlloc and rep_stos.
788808
n.isCFG = true;
789809
} else if (n.isBlockStart || n.isBlockProjection) {
790810
// Example: Root.

0 commit comments

Comments
 (0)