changeset 8537:da674936800c

InvokeNode: remove dead code in intrinsify it was actually used in a test case, but that can be replaced by inlining
author Bernhard Urban <bernhard.urban@jku.at>
date Wed, 27 Mar 2013 18:12:03 +0100
parents 2978a819763b
children 04b002b7077f 147db03bb0a5 bbd8167f21f9 cd9e8dd9f488
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/DegeneratedLoopsTest.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java
diffstat 2 files changed, 12 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- 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);
             }
         });
--- 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()) {