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);
}
}
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;
}
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);
}
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);
}
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);
}
Aggregations