use of org.graalvm.compiler.nodes.loop.InductionVariable in project graal by oracle.
the class AMD64HotSpotAddressLowering method tryOptimize.
private static void tryOptimize(OffsetAddressNode offsetAddress, LoopEx loop) {
EconomicMap<Node, InductionVariable> ivs = loop.getInductionVariables();
InductionVariable currentIV = ivs.get(offsetAddress.getOffset());
while (currentIV != null) {
if (!(currentIV instanceof DerivedInductionVariable)) {
break;
}
ValueNode currentValue = currentIV.valueNode();
if (currentValue.isDeleted()) {
break;
}
if (currentValue instanceof ZeroExtendNode) {
ZeroExtendNode zeroExtendNode = (ZeroExtendNode) currentValue;
if (applicableToImplicitZeroExtend(zeroExtendNode)) {
ValueNode input = zeroExtendNode.getValue();
if (input instanceof AddNode) {
AddNode add = (AddNode) input;
if (add.getX().isConstant()) {
optimizeAdd(zeroExtendNode, (ConstantNode) add.getX(), add.getY(), loop);
} else if (add.getY().isConstant()) {
optimizeAdd(zeroExtendNode, (ConstantNode) add.getY(), add.getX(), loop);
}
}
}
}
currentIV = ((DerivedInductionVariable) currentIV).getBase();
}
}
Aggregations