# HG changeset patch # User Bernhard Urban # Date 1364404323 -3600 # Node ID da674936800c9ed467a2f2b298d0a63f184c6fa2 # Parent 2978a819763b73ee4414c2ffa24144059401e3ba InvokeNode: remove dead code in intrinsify it was actually used in a test case, but that can be replaced by inlining diff -r 2978a819763b -r da674936800c graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/DegeneratedLoopsTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/DegeneratedLoopsTest.java Wed Mar 27 19:11:30 2013 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/DegeneratedLoopsTest.java Wed Mar 27 18:12:03 2013 +0100 @@ -27,6 +27,7 @@ import com.oracle.graal.api.code.*; import com.oracle.graal.debug.*; import com.oracle.graal.nodes.*; +import com.oracle.graal.phases.*; import com.oracle.graal.phases.common.*; /** @@ -80,13 +81,11 @@ public void run() { StructuredGraph graph = parse(snippet); + new InliningPhase(runtime(), null, new Assumptions(false), null, getDefaultPhasePlan(), OptimisticOptimizations.ALL).apply(graph); + new CanonicalizerPhase(runtime(), new Assumptions(false)).apply(graph); Debug.dump(graph, "Graph"); - for (Invoke invoke : graph.getInvokes()) { - invoke.intrinsify(null); - } - new CanonicalizerPhase(runtime(), new Assumptions(false)).apply(graph); StructuredGraph referenceGraph = parse(REFERENCE_SNIPPET); - Debug.dump(referenceGraph, "Graph"); + Debug.dump(referenceGraph, "ReferenceGraph"); assertEquals(referenceGraph, graph); } }); diff -r 2978a819763b -r da674936800c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Wed Mar 27 19:11:30 2013 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Wed Mar 27 18:12:03 2013 +0100 @@ -160,20 +160,15 @@ StateSplit stateSplit = (StateSplit) node; stateSplit.setStateAfter(stateAfter); } - if (node == null) { - assert kind() == Kind.Void && usages().isEmpty(); - ((StructuredGraph) graph()).removeFixed(this); + if (node instanceof FixedWithNextNode) { + ((StructuredGraph) graph()).replaceFixedWithFixed(this, (FixedWithNextNode) node); + } else if (node instanceof DeoptimizeNode) { + this.replaceAtPredecessor(node); + this.replaceAtUsages(null); + GraphUtil.killCFG(this); + return; } else { - if (node instanceof FixedWithNextNode) { - ((StructuredGraph) graph()).replaceFixedWithFixed(this, (FixedWithNextNode) node); - } else if (node instanceof DeoptimizeNode) { - this.replaceAtPredecessor(node); - this.replaceAtUsages(null); - GraphUtil.killCFG(this); - return; - } else { - ((StructuredGraph) graph()).replaceFixed(this, node); - } + ((StructuredGraph) graph()).replaceFixed(this, node); } call.safeDelete(); if (stateAfter.usages().isEmpty()) {