use of org.graalvm.compiler.core.common.type.IntegerStamp in project graal by oracle.
the class IntegerAddExactSplitNode method simplify.
@Override
public void simplify(SimplifierTool tool) {
NodeView view = NodeView.from(tool);
if (!IntegerStamp.addCanOverflow((IntegerStamp) x.stamp(view), (IntegerStamp) y.stamp(view))) {
tool.deleteBranch(overflowSuccessor);
tool.addToWorkList(next);
AddNode replacement = graph().unique(new AddNode(x, y));
graph().replaceSplitWithFloating(this, replacement, next);
tool.addToWorkList(replacement);
}
}
use of org.graalvm.compiler.core.common.type.IntegerStamp in project graal by oracle.
the class IntegerMulExactSplitNode method simplify.
@Override
public void simplify(SimplifierTool tool) {
NodeView view = NodeView.from(tool);
if (!IntegerStamp.multiplicationCanOverflow((IntegerStamp) x.stamp(view), (IntegerStamp) y.stamp(view))) {
tool.deleteBranch(overflowSuccessor);
tool.addToWorkList(next);
MulNode replacement = graph().unique(new MulNode(x, y));
graph().replaceSplitWithFloating(this, replacement, next);
tool.addToWorkList(replacement);
}
}
use of org.graalvm.compiler.core.common.type.IntegerStamp 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.core.common.type.IntegerStamp in project graal by oracle.
the class IntegerTestNode method tryFold.
@Override
public TriState tryFold(Stamp xStampGeneric, Stamp yStampGeneric) {
if (xStampGeneric instanceof IntegerStamp && yStampGeneric instanceof IntegerStamp) {
IntegerStamp xStamp = (IntegerStamp) xStampGeneric;
IntegerStamp yStamp = (IntegerStamp) yStampGeneric;
if ((xStamp.upMask() & yStamp.upMask()) == 0) {
return TriState.TRUE;
} else if ((xStamp.downMask() & yStamp.downMask()) != 0) {
return TriState.FALSE;
}
}
return TriState.UNKNOWN;
}
use of org.graalvm.compiler.core.common.type.IntegerStamp in project graal by oracle.
the class LeftShiftNode method create.
public static ValueNode create(ValueNode x, ValueNode y, NodeView view) {
ArithmeticOpTable.ShiftOp<Shl> op = ArithmeticOpTable.forStamp(x.stamp(view)).getShl();
Stamp stamp = op.foldStamp(x.stamp(view), (IntegerStamp) y.stamp(view));
ValueNode value = ShiftNode.canonical(op, stamp, x, y, view);
if (value != null) {
return value;
}
return canonical(null, op, stamp, x, y);
}
Aggregations