Mercurial > hg > truffle
changeset 16506:505c17ed39da
LSRA spill optimization: use AbstractControlFlowGraph.commonDominator.
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Mon, 14 Jul 2014 19:56:44 +0200 |
parents | 45f92700119f |
children | 32f326c239a5 |
files | graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java |
diffstat | 1 files changed, 1 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Mon Jul 14 19:32:01 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Mon Jul 14 19:56:44 2014 +0200 @@ -1956,7 +1956,7 @@ if (spillBlock == null) { spillBlock = splitBlock; } else { - spillBlock = nearestCommonDominator(spillBlock, splitBlock); + spillBlock = commonDominator(spillBlock, splitBlock); assert spillBlock != null; } } @@ -2086,35 +2086,6 @@ return defBlock; } - private AbstractBlock<?> nearestCommonDominator(AbstractBlock<?> a, AbstractBlock<?> b) { - assert a != null; - assert b != null; - try (Indent indent = Debug.logAndIndent("nearest common dominator of %s and %s", a, b)) { - - if (a.equals(b)) { - return a; - } - - // collect a's dominators - BitSet aDom = new BitSet(sortedBlocks.size()); - - // a != b - for (AbstractBlock<?> x = a; x != null; x = x.getDominator()) { - aDom.set(x.getId()); - } - - // walk b's dominator - for (AbstractBlock<?> x = b; x != null; x = x.getDominator()) { - if (aDom.get(x.getId())) { - Debug.log("found %s", x); - return x; - } - } - } - Debug.log("no common dominator found"); - return null; - } - void printIntervals(String label) { if (Debug.isLogEnabled()) { try (Indent indent = Debug.logAndIndent("intervals %s", label)) {