Skip to content
Permalink
Browse files
8276105: C2: Conv(D|F)2(I|L)Nodes::Ideal should handle rounding corre…
…ctly

Reviewed-by: aph
Backport-of: 0488ebdf14dacfa79d98de16ed949c813dd88701
  • Loading branch information
shipilev committed Nov 16, 2021
1 parent 93d8337 commit 95726bf738c2d6b107b9dfa0eb4f16c0f58b7207
Showing 1 changed file with 16 additions and 8 deletions.
@@ -108,8 +108,10 @@ const Type* ConvD2INode::Value(PhaseGVN* phase) const {
//------------------------------Ideal------------------------------------------
// If converting to an int type, skip any rounding nodes
Node *ConvD2INode::Ideal(PhaseGVN *phase, bool can_reshape) {
if( in(1)->Opcode() == Op_RoundDouble )
set_req(1,in(1)->in(1));
if (in(1)->Opcode() == Op_RoundDouble) {
set_req(1, in(1)->in(1));
return this;
}
return NULL;
}

@@ -142,8 +144,10 @@ Node* ConvD2LNode::Identity(PhaseGVN* phase) {
//------------------------------Ideal------------------------------------------
// If converting to an int type, skip any rounding nodes
Node *ConvD2LNode::Ideal(PhaseGVN *phase, bool can_reshape) {
if( in(1)->Opcode() == Op_RoundDouble )
set_req(1,in(1)->in(1));
if (in(1)->Opcode() == Op_RoundDouble) {
set_req(1, in(1)->in(1));
return this;
}
return NULL;
}

@@ -179,8 +183,10 @@ Node* ConvF2INode::Identity(PhaseGVN* phase) {
//------------------------------Ideal------------------------------------------
// If converting to an int type, skip any rounding nodes
Node *ConvF2INode::Ideal(PhaseGVN *phase, bool can_reshape) {
if( in(1)->Opcode() == Op_RoundFloat )
set_req(1,in(1)->in(1));
if (in(1)->Opcode() == Op_RoundFloat) {
set_req(1, in(1)->in(1));
return this;
}
return NULL;
}

@@ -206,8 +212,10 @@ Node* ConvF2LNode::Identity(PhaseGVN* phase) {
//------------------------------Ideal------------------------------------------
// If converting to an int type, skip any rounding nodes
Node *ConvF2LNode::Ideal(PhaseGVN *phase, bool can_reshape) {
if( in(1)->Opcode() == Op_RoundFloat )
set_req(1,in(1)->in(1));
if (in(1)->Opcode() == Op_RoundFloat) {
set_req(1, in(1)->in(1));
return this;
}
return NULL;
}

1 comment on commit 95726bf

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 95726bf Nov 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.