Skip to content

Commit

Permalink
[GR-33248] Fix DerivedConvertedInductionVariable zero extend
Browse files Browse the repository at this point in the history
PullRequest: graal/9821
  • Loading branch information
andrewcraik committed Sep 22, 2021
2 parents 091d31a + 241163d commit 2335ce8
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public Direction direction() {

@Override
public ValueNode initNode() {
return op(base.initNode());
return op(base.initNode(), true);
}

@Override
public ValueNode strideNode() {
return op(base.strideNode());
return op(base.strideNode(), false);
}

@Override
Expand Down Expand Up @@ -88,7 +88,7 @@ public ValueNode extremumNode(boolean assumeLoopEntered, Stamp s) {

@Override
public ValueNode exitValueNode() {
return op(base.exitValueNode());
return op(base.exitValueNode(), true);
}

@Override
Expand All @@ -105,8 +105,8 @@ public long constantExtremum() {
public void deleteUnusedNodes() {
}

public ValueNode op(ValueNode v) {
boolean zeroExtend = value instanceof ZeroExtendNode;
private ValueNode op(ValueNode v, boolean allowZeroExtend) {
boolean zeroExtend = allowZeroExtend && value instanceof ZeroExtendNode;
return IntegerConvertNode.convert(v, stamp, zeroExtend, graph(), NodeView.DEFAULT);
}

Expand All @@ -122,7 +122,7 @@ public InductionVariable copy(InductionVariable newBase, ValueNode newValue) {

@Override
public ValueNode copyValue(InductionVariable newBase) {
return op(newBase.valueNode());
return op(newBase.valueNode(), true);
}

}

0 comments on commit 2335ce8

Please sign in to comment.