# HG changeset patch # User Josef Eisl # Date 1440765162 -7200 # Node ID 5b0239e1d562aebbf7df6af0e62898681e219833 # Parent b1d4fd32135f951d340c1368671ce1d34284cc53 TraceRA: only blocks with LabelOp and JumpOp are trivial. diff -r b1d4fd32135f -r 5b0239e1d562 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceRegisterAllocationPhase.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceRegisterAllocationPhase.java Fri Aug 28 13:46:09 2015 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/alloc/trace/TraceRegisterAllocationPhase.java Fri Aug 28 14:32:42 2015 +0200 @@ -36,7 +36,7 @@ import com.oracle.graal.debug.*; import com.oracle.graal.debug.Debug.Scope; import com.oracle.graal.lir.*; -import com.oracle.graal.lir.StandardOp.ValueMoveOp; +import com.oracle.graal.lir.StandardOp.*; import com.oracle.graal.lir.gen.*; import com.oracle.graal.lir.gen.LIRGeneratorTool.SpillMoveFactory; import com.oracle.graal.lir.phases.*; @@ -116,7 +116,19 @@ } static boolean isTrivialTrace(LIR lir, List> trace) { - return trace.size() == 1 && lir.getLIRforBlock(trace.iterator().next()).size() == 2; + if (trace.size() != 1) { + return false; + } + List instructions = lir.getLIRforBlock(trace.iterator().next()); + if (instructions.size() != 2) { + return false; + } + assert instructions.get(0) instanceof LabelOp : "First instruction not a LabelOp: " + instructions.get(0); + /* + * Now we need to check if the BlockEndOp has no special operand requirements (i.e. + * stack-slot, register). For now we just check for JumpOp because we know that it doesn't. + */ + return instructions.get(1) instanceof JumpOp; } /**