From 65b5a2e3e4f9882adca587b9fed90223b93302a0 Mon Sep 17 00:00:00 2001 From: Daniel Skantz Date: Tue, 3 Dec 2024 13:32:28 +0000 Subject: [PATCH] 8345158: IGV: local scheduling should not place successors before predecessors Reviewed-by: rcastanedalo, chagedorn --- .../hotspot/igv/servercompiler/ServerCompilerScheduler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/IdealGraphVisualizer/ServerCompiler/src/main/java/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java b/src/utils/IdealGraphVisualizer/ServerCompiler/src/main/java/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java index 378e3bb6d40ec..95a0b71c16df3 100644 --- a/src/utils/IdealGraphVisualizer/ServerCompiler/src/main/java/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java +++ b/src/utils/IdealGraphVisualizer/ServerCompiler/src/main/java/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java @@ -382,7 +382,7 @@ private void scheduleLocal() { }; private List scheduleBlock(Collection nodes) { - List schedule = new ArrayList<>(); + LinkedHashSet schedule = new LinkedHashSet(); // Initialize ready priority queue with nodes without predecessors. Queue ready = new PriorityQueue<>(schedulePriority); @@ -407,7 +407,7 @@ private List scheduleBlock(Collection nodes) { } boolean allPredsScheduled = true; for (Node p : s.preds) { - if (!visited.contains(p)) { + if (!schedule.contains(p.inputNode)) { allPredsScheduled = false; break; } @@ -419,7 +419,7 @@ private List scheduleBlock(Collection nodes) { } } assert(schedule.size() == nodes.size()); - return schedule; + return new ArrayList(schedule); } // Return latest block that dominates all successors of n, or null if any