Mercurial > hg > graal-compiler
changeset 23047:7be98e30bc80
Add matcher rules for pointer comparisons.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 21 Nov 2015 16:48:58 +0100 |
parents | 123324a0f36f |
children | 4929b9470674 bbdf5fb03cb8 |
files | graal/com.oracle.graal.compiler.amd64/src/com/oracle/graal/compiler/amd64/AMD64NodeMatchRules.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeMatchRules.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/substitutions/TruffleGraphBuilderPlugins.java |
diffstat | 3 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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); }
--- 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)
--- 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