use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.
the class NormalizeCompareNode method canonical.
@Override
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
NodeView view = NodeView.from(tool);
ValueNode result = tryConstantFold(x, y, isUnorderedLess, stamp(view).getStackKind(), tool.getConstantReflection());
if (result != null) {
return result;
}
return this;
}
use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.
the class OrNode 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;
}
return canonical(this, getOp(forX, forY), stamp(view), forX, forY, view);
}
use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.
the class AddNode 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 AddNode(forY, forX);
}
BinaryOp<Add> op = getOp(forX, forY);
NodeView view = NodeView.from(tool);
return canonical(this, op, forX, forY, view);
}
use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.
the class AndNode method canonical.
@Override
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
ValueNode ret = super.canonical(tool, forX, forY);
if (ret != this) {
return ret;
}
NodeView view = NodeView.from(tool);
return canonical(this, getOp(forX, forY), stamp(view), forX, forY, view);
}
use of org.graalvm.compiler.nodes.NodeView in project graal by oracle.
the class BinaryArithmeticNode method canonical.
@Override
public ValueNode canonical(CanonicalizerTool tool, ValueNode forX, ValueNode forY) {
NodeView view = NodeView.from(tool);
ValueNode result = tryConstantFold(getOp(forX, forY), forX, forY, stamp(view), view);
if (result != null) {
return result;
}
return this;
}
Aggregations