# HG changeset patch # User Thomas Wuerthinger # Date 1303921038 -7200 # Node ID eca17668badf3057f5ce529b586aea08249364f0 # Parent 7e7f817bdb2894c54b6bed36cfc22ba932a12f8b Remove dead code elimination 1 diff -r 7e7f817bdb28 -r eca17668badf graal/GraalCompiler/src/com/sun/c1x/graph/IR.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Wed Apr 27 17:05:26 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Wed Apr 27 18:17:18 2011 +0200 @@ -28,7 +28,6 @@ import com.sun.c1x.debug.*; import com.sun.c1x.ir.*; import com.sun.c1x.observer.*; -import com.sun.c1x.opt.*; import com.sun.c1x.value.*; /** @@ -88,7 +87,6 @@ C1XTimers.HIR_OPTIMIZE.start(); } - optimize1(); computeLinearScanOrder(); if (C1XOptions.PrintTimers) { @@ -109,13 +107,6 @@ } } - private void optimize1() { - if (C1XOptions.OptDeadCodeElimination1) { - new LivenessMarker(this).removeDeadCode(); - verifyAndPrint("After dead code elimination 1"); - } - } - private void computeLinearScanOrder() { if (C1XOptions.GenLIR) { makeLinearScanOrder(); diff -r 7e7f817bdb28 -r eca17668badf graal/GraalCompiler/src/com/sun/c1x/opt/LivenessMarker.java --- a/graal/GraalCompiler/src/com/sun/c1x/opt/LivenessMarker.java Wed Apr 27 17:05:26 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/opt/LivenessMarker.java Wed Apr 27 18:17:18 2011 +0200 @@ -24,7 +24,6 @@ import static com.sun.c1x.ir.Value.Flag.*; -import com.sun.c1x.*; import com.sun.c1x.graph.*; import com.sun.c1x.ir.*; import com.sun.c1x.value.*; @@ -79,28 +78,6 @@ return count; } - public void removeDeadCode() { - // second pass: remove dead instructions from blocks - ir.startBlock.iteratePreOrder(new BlockClosure() { - public void apply(BlockBegin block) { - Instruction prev = block; - Instruction i = block.next(); - while (i != null) { - if (i.isLive()) { - prev.resetNext(i); // skip any previous dead instructions - prev = i; - } else { - C1XMetrics.DeadCodeEliminated++; - } - i = i.next(); - } - } - }); - // clear all marks on all instructions - valueMarker.clearAll(); - deoptMarker.clearAll(); - } - private static class Link { final Value value; Link next;