# HG changeset patch # User Thomas Wuerthinger # Date 1422374170 -3600 # Node ID c597c72e163b7027d6394a922d373edf1bc52d1c # Parent 78f9a57525af2f79d87c49a4143e8e5a5951d1e3 Do not compute region set in SchedulePhase. Use new API of ReentrantBlockIterator. diff -r 78f9a57525af -r c597c72e163b graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Tue Jan 27 16:52:25 2015 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Tue Jan 27 16:56:10 2015 +0100 @@ -521,9 +521,6 @@ // the dominated block is not a successor -> we have a split assert dominatedBlock.getBeginNode() instanceof MergeNode; - HashSet region = computeRegion(currentBlock, dominatedBlock); - Debug.log("> merge. %s: region for %s -> %s: %s", n, currentBlock, dominatedBlock, region); - NewMemoryScheduleClosure closure = null; if (currentBlock == upperBoundBlock) { assert earliestBlock == upperBoundBlock; @@ -533,7 +530,7 @@ closure = new NewMemoryScheduleClosure(); } Map states; - states = ReentrantBlockIterator.apply(closure, currentBlock, new KillSet(), (block) -> !region.contains(block)); + states = ReentrantBlockIterator.apply(closure, currentBlock, new KillSet(), block -> block == dominatedBlock); KillSet mergeState = states.get(dominatedBlock.getBeginNode()); if (mergeState.isKilled(locid)) { @@ -573,31 +570,6 @@ } /** - * compute a set that contains all blocks in a region spanned by dominatorBlock and - * dominatedBlock (exclusive the dominatedBlock). - */ - private static HashSet computeRegion(Block dominatorBlock, Block dominatedBlock) { - HashSet region = new HashSet<>(); - Queue workList = new LinkedList<>(); - - region.add(dominatorBlock); - workList.addAll(dominatorBlock.getSuccessors()); - while (workList.size() > 0) { - Block current = workList.poll(); - if (current != dominatedBlock) { - region.add(current); - for (Block b : current.getSuccessors()) { - if (!region.contains(b) && !workList.contains(b)) { - workList.offer(b); - } - } - } - } - assert !region.contains(dominatedBlock) && region.containsAll(dominatedBlock.getPredecessors()); - return region; - } - - /** * Calculates the last block that the given node could be scheduled in, i.e., the common * dominator of all usages. To do so all usages are also assigned to blocks. *