# HG changeset patch # User Christian Wimmer # Date 1392229401 28800 # Node ID 814800074308f9a9819c3a333aec3706b6c8391d # Parent e79579c921ff0db41ce516b8ef825a954960dc32 Allow disabling of redundant move elimination diff -r e79579c921ff -r 814800074308 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Wed Feb 12 10:22:48 2014 -0800 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Wed Feb 12 10:23:21 2014 -0800 @@ -280,7 +280,9 @@ try (Scope s = Debug.scope("ControlFlowOptimizations")) { EdgeMoveOptimizer.optimize(lir); ControlFlowOptimizer.optimize(lir); - RedundantMoveElimination.optimize(lir, frameMap, lirGen.getGraph().method()); + if (lirGen.canEliminateRedundantMoves()) { + RedundantMoveElimination.optimize(lir, frameMap, lirGen.getGraph().method()); + } NullCheckOptimizer.optimize(lir, target.implicitNullCheckLimit); Debug.dump(lir, "After control flow optimization"); diff -r e79579c921ff -r 814800074308 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Wed Feb 12 10:22:48 2014 -0800 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Wed Feb 12 10:23:21 2014 -0800 @@ -219,6 +219,14 @@ return null; } + /** + * Returns true if the redundant move elimination optimization should be done after register + * allocation. + */ + public boolean canEliminateRedundantMoves() { + return true; + } + @SuppressWarnings("hiding") protected DebugInfoBuilder createDebugInfoBuilder(NodeMap nodeOperands) { return new DebugInfoBuilder(nodeOperands);