Search in sources :

Example 11 with NodeView

use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.

the class IntegerSubExactSplitNode method simplify.

@Override
public void simplify(SimplifierTool tool) {
    NodeView view = NodeView.from(tool);
    if (!IntegerStamp.subtractionCanOverflow((IntegerStamp) x.stamp(view), (IntegerStamp) y.stamp(view))) {
        tool.deleteBranch(overflowSuccessor);
        tool.addToWorkList(next);
        SubNode replacement = graph().unique(new SubNode(x, y));
        graph().replaceSplitWithFloating(this, replacement, next);
        tool.addToWorkList(replacement);
    }
}
Also used : SubNode(org.graalvm.compiler.nodes.calc.SubNode) IntegerStamp(org.graalvm.compiler.core.common.type.IntegerStamp) NodeView(org.graalvm.compiler.nodes.NodeView)

Example 12 with NodeView

use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.

the class ShiftNode method canonical.

@Override
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
    NodeView view = NodeView.from(tool);
    ValueNode valueNode = canonical(getOp(forX), stamp(NodeView.DEFAULT), forX, forY, view);
    if (valueNode != null) {
        return valueNode;
    }
    return this;
}
Also used : ValueNode(org.graalvm.compiler.nodes.ValueNode) NodeView(org.graalvm.compiler.nodes.NodeView)

Example 13 with NodeView

use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.

the class SignExtendNode method canonical.

@Override
public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) {
    NodeView view = NodeView.from(tool);
    ValueNode ret = super.canonical(tool, forValue);
    if (ret != this) {
        return ret;
    }
    return canonical(this, forValue, getInputBits(), getResultBits(), view);
}
Also used : ValueNode(org.graalvm.compiler.nodes.ValueNode) NodeView(org.graalvm.compiler.nodes.NodeView)

Example 14 with NodeView

use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.

the class SubNode method canonical.

@Override
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
    NodeView view = NodeView.from(tool);
    ValueNode ret = super.canonical(tool, forX, forY);
    if (ret != this) {
        return ret;
    }
    BinaryOp<Sub> op = getOp(forX, forY);
    return canonical(this, op, stamp, forX, forY, view);
}
Also used : Sub(org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.Sub) ValueNode(org.graalvm.compiler.nodes.ValueNode) NodeView(org.graalvm.compiler.nodes.NodeView)

Example 15 with NodeView

use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.

the class MulNode method canonical.

@Override
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
    ValueNode ret = super.canonical(tool, forX, forY);
    if (ret != this) {
        return ret;
    }
    if (forX.isConstant() && !forY.isConstant()) {
        // we try to swap and canonicalize
        ValueNode improvement = canonical(tool, forY, forX);
        if (improvement != this) {
            return improvement;
        }
        // if this fails we only swap
        return new MulNode(forY, forX);
    }
    BinaryOp<Mul> op = getOp(forX, forY);
    NodeView view = NodeView.from(tool);
    return canonical(this, op, stamp(view), forX, forY, view);
}
Also used : Mul(org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.Mul) ValueNode(org.graalvm.compiler.nodes.ValueNode) NodeView(org.graalvm.compiler.nodes.NodeView)

Aggregations

NodeView (org.graalvm.compiler.nodes.NodeView)37 ValueNode (org.graalvm.compiler.nodes.ValueNode)28 IntegerStamp (org.graalvm.compiler.core.common.type.IntegerStamp)6 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)4 Constant (jdk.vm.ci.meta.Constant)3 MetaAccessProvider (jdk.vm.ci.meta.MetaAccessProvider)2 LogicNode (org.graalvm.compiler.nodes.LogicNode)2 AddNode (org.graalvm.compiler.nodes.calc.AddNode)2 MulNode (org.graalvm.compiler.nodes.calc.MulNode)2 ArrayList (java.util.ArrayList)1 Assumptions (jdk.vm.ci.meta.Assumptions)1 JavaConstant (jdk.vm.ci.meta.JavaConstant)1 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)1 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)1 Add (org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.Add)1 Mul (org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.Mul)1 Sub (org.graalvm.compiler.core.common.type.ArithmeticOpTable.BinaryOp.Sub)1 FloatStamp (org.graalvm.compiler.core.common.type.FloatStamp)1 ObjectStamp (org.graalvm.compiler.core.common.type.ObjectStamp)1 Stamp (org.graalvm.compiler.core.common.type.Stamp)1