# HG changeset patch # User Thomas Wuerthinger # Date 1306532843 -7200 # Node ID 50b5db2c3e68afc29c42a20943d9600012429265 # Parent f35c6f8f0f5dec16538c8c50741384f8bafcfdd3 Fix for degenerated phis. Now jtt and DaCapo/fop passes with ArithmeticOp and Constant being flexible in the graph. diff -r f35c6f8f0f5d -r 50b5db2c3e68 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:38:52 2011 +0200 +++ b/graal/GraalCompiler/src/com/oracle/max/graal/schedule/Schedule.java Fri May 27 23:47:23 2011 +0200 @@ -95,7 +95,7 @@ return false; } - if (n instanceof LoopBegin || n instanceof LoopEnd) { + if (n instanceof LoopBegin) { // a LoopBegin is always a merge assignBlock(n); blockBeginNodes.add(n); @@ -234,6 +234,12 @@ assert mergeBlock != null; for (int i = 0; i < phi.valueCount(); ++i) { if (phi.valueAt(i) == n) { + if (mergeBlock.getPredecessors().size() == 0) { + TTY.println(merge.toString()); + TTY.println(phi.toString()); + TTY.println(merge.predecessors().toString()); + TTY.println("value count: " + phi.valueCount()); + } block = getCommonDominator(block, mergeBlock.getPredecessors().get(i)); } } diff -r f35c6f8f0f5d -r 50b5db2c3e68 graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Fri May 27 23:38:52 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Fri May 27 23:47:23 2011 +0200 @@ -192,8 +192,6 @@ variablesForConstants = new ArrayList(); this.operands = new OperandPool(compilation.target); - - new PhiSimplifier(ir); } public ArrayList deoptimizationStubs() { diff -r f35c6f8f0f5d -r 50b5db2c3e68 graal/GraalCompiler/src/com/sun/c1x/graph/IR.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Fri May 27 23:38:52 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Fri May 27 23:47:23 2011 +0200 @@ -28,6 +28,7 @@ import com.oracle.max.graal.schedule.*; import com.sun.c1x.*; import com.sun.c1x.debug.*; +import com.sun.c1x.gen.*; import com.sun.c1x.ir.*; import com.sun.c1x.lir.*; import com.sun.c1x.observer.*; @@ -80,6 +81,7 @@ C1XTimers.HIR_OPTIMIZE.start(); } + new PhiSimplifier(this); Schedule schedule = new Schedule(this.compilation.graph); List blocks = schedule.getBlocks(); List lirBlocks = new ArrayList();