# HG changeset patch # User Lukas Stadler # Date 1306755743 -7200 # Node ID 189ffb7d1d846348c72b6b91ce9c74286b788481 # Parent 50b5db2c3e68afc29c42a20943d9600012429265 enable PhiSimplifier, schedule values used in a merge's stateBefore in the dominator diff -r 50b5db2c3e68 -r 189ffb7d1d84 graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java --- a/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java Fri May 27 23:47:23 2011 +0200 +++ b/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java Mon May 30 13:42:23 2011 +0200 @@ -243,6 +243,13 @@ block = getCommonDominator(block, mergeBlock.getPredecessors().get(i)); } } + } else if (usage instanceof FrameState && ((FrameState) usage).block() != null) { + Merge merge = ((FrameState) usage).block(); + for (Node pred : merge.predecessors()) { + if (isCFG(pred)) { + block = getCommonDominator(block, nodeToBlock.get(pred)); + } + } } else { block = getCommonDominator(block, assignLatestPossibleBlockToNode(usage)); } diff -r 50b5db2c3e68 -r 189ffb7d1d84 graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java --- a/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java Fri May 27 23:47:23 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/alloc/LinearScan.java Mon May 30 13:42:23 2011 +0200 @@ -849,9 +849,15 @@ LIRBlock block = blockAt(j); if (block.liveGen.get(operandNum)) { TTY.println(" used in block B%d", block.blockID()); + for (LIRInstruction ins : block.lir().instructionsList()) { + TTY.println(ins.id + ": " + ins.result() + " " + ins.toString()); + } } if (block.liveKill.get(operandNum)) { TTY.println(" defined in block B%d", block.blockID()); + for (LIRInstruction ins : block.lir().instructionsList()) { + TTY.println(ins.id + ": " + ins.result() + " " + ins.toString()); + } } } } diff -r 50b5db2c3e68 -r 189ffb7d1d84 graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java Fri May 27 23:47:23 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/PhiSimplifier.java Mon May 30 13:42:23 2011 +0200 @@ -45,7 +45,7 @@ } Phi phi = (Phi) x; - if (phi.valueCount() == 1) { + if (phi.valueCount() == 1 && !phi.checkFlag(Value.Flag.PhiCannotSimplify)) { return (Value) phi.replace(phi.valueAt(0)); } @@ -105,6 +105,10 @@ // successfully simplified the phi assert phiSubst != null : "illegal phi function"; phi.clearFlag(Value.Flag.PhiVisited); + + phi.replace(phiSubst); +// System.out.printf("replaced phi with %d inputs\n", max); + return phiSubst; } } diff -r 50b5db2c3e68 -r 189ffb7d1d84 graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java --- a/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Fri May 27 23:47:23 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Mon May 30 13:42:23 2011 +0200 @@ -381,6 +381,16 @@ } } + public Merge block() { + if (usages().size() > 0) { + assert usages().size() == 1; + Node node = usages().get(0); + if (node instanceof Merge) { + return (Merge) node; + } + } + return null; + } /** * The interface implemented by a client of {@link FrameState#forEachPhi(Merge, PhiProcedure)} and diff -r 50b5db2c3e68 -r 189ffb7d1d84 runscimark.sh --- a/runscimark.sh Fri May 27 23:47:23 2011 +0200 +++ b/runscimark.sh Mon May 30 13:42:23 2011 +0200 @@ -23,5 +23,5 @@ for (( i = 1; i <= ${COUNT}; i++ )) ### Outer for loop ### do echo "$i " - ${JDK7}/jre/bin/java -client -d64 -graal -esa -ea -Xms32m -Xmx100m -Xbootclasspath/a:${SCIMARK} -C1X:+PrintTimers $@ jnt.scimark2.commandline -large + ${JDK7}/jre/bin/java -client -d64 -graal -esa -ea -Xms32m -Xmx100m -Xbootclasspath/a:${SCIMARK} -C1X:+PrintTimers $@ jnt.scimark2.commandline done