# HG changeset patch # User Thomas Wuerthinger # Date 1448120938 -3600 # Node ID 7be98e30bc8092769e00ff72e14b6d41358ce87a # Parent 123324a0f36f34a5202df8c83be725a082b3a538 Add matcher rules for pointer comparisons. diff -r 123324a0f36f -r 7be98e30bc80 graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java --- a/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java Sat Nov 21 02:09:20 2015 +0100 +++ b/graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java Sat Nov 21 16:48:58 2015 +0100 @@ -72,7 +72,6 @@ import jdk.vm.ci.amd64.AMD64Kind; import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.LIRKind; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.Value; @@ -135,10 +134,6 @@ Debug.log("Skipping constant compares for float kinds"); return null; } - if (constant != null && constant.getJavaKind() == JavaKind.Object && !constant.isNull()) { - Debug.log("Skipping constant compares for Object kinds"); - return null; - } } // emitCompareBranchMemory expects the memory on the right, so mirror the condition if @@ -271,6 +266,8 @@ @MatchRule("(If (FloatEquals=compare value FloatingRead=access))") @MatchRule("(If (FloatLessThan=compare value Read=access))") @MatchRule("(If (FloatLessThan=compare value FloatingRead=access))") + @MatchRule("(If (PointerEquals=compare value Read=access))") + @MatchRule("(If (PointerEquals=compare value FloatingRead=access))") public ComplexMatchResult ifCompareMemory(IfNode root, CompareNode compare, ValueNode value, Access access) { return emitCompareBranchMemory(root, compare, value, access); } diff -r 123324a0f36f -r 7be98e30bc80 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeMatchRules.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeMatchRules.java Sat Nov 21 02:09:20 2015 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeMatchRules.java Sat Nov 21 16:48:58 2015 +0100 @@ -49,6 +49,7 @@ import com.oracle.graal.nodes.calc.NarrowNode; import com.oracle.graal.nodes.calc.ObjectEqualsNode; import com.oracle.graal.nodes.calc.OrNode; +import com.oracle.graal.nodes.calc.PointerEqualsNode; import com.oracle.graal.nodes.calc.ReinterpretNode; import com.oracle.graal.nodes.calc.SignExtendNode; import com.oracle.graal.nodes.calc.SubNode; @@ -75,6 +76,7 @@ @MatchableNode(nodeClass = AndNode.class, inputs = {"x", "y"}, commutative = true) @MatchableNode(nodeClass = FloatEqualsNode.class, inputs = {"x", "y"}, commutative = true) @MatchableNode(nodeClass = FloatLessThanNode.class, inputs = {"x", "y"}, commutative = true) +@MatchableNode(nodeClass = PointerEqualsNode.class, inputs = {"x", "y"}, commutative = true) @MatchableNode(nodeClass = AddNode.class, inputs = {"x", "y"}, commutative = true) @MatchableNode(nodeClass = IntegerBelowNode.class, inputs = {"x", "y"}, commutative = true) @MatchableNode(nodeClass = IntegerEqualsNode.class, inputs = {"x", "y"}, commutative = true) diff -r 123324a0f36f -r 7be98e30bc80 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java Sat Nov 21 02:09:20 2015 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java Sat Nov 21 16:48:58 2015 +0100 @@ -228,7 +228,7 @@ * and constant folding could still eliminate the call to bailout(). However, we * also want to stop parsing, since we are sure that we will never need the * graph beyond the bailout point. - * + * * Therefore, we manually emit the call to bailout, which will be intrinsified * later when intrinsifications can no longer be delayed. The call is followed * by a NeverPartOfCompilationNode, which is a control sink and therefore stops