use of org.graalvm.compiler.nodes.calc.SubNode in project graal by oracle.
the class BasicInductionVariable method direction.
@Override
public Direction direction() {
Stamp stamp = rawStride.stamp(NodeView.DEFAULT);
if (stamp instanceof IntegerStamp) {
IntegerStamp integerStamp = (IntegerStamp) stamp;
Direction dir = null;
if (integerStamp.isStrictlyPositive()) {
dir = Direction.Up;
} else if (integerStamp.isStrictlyNegative()) {
dir = Direction.Down;
}
if (dir != null) {
if (op instanceof AddNode) {
return dir;
} else {
assert op instanceof SubNode;
return dir.opposite();
}
}
}
return null;
}
Aggregations