8276105: C2: Conv(D|F)2(I|L)Nodes::Ideal should handle rounding correctly

Reviewed-by: kvn, thartmann
This commit is contained in:
Aleksey Shipilev 2021-11-02 06:38:26 +00:00
parent acceffcbf7
commit 0488ebdf14

View File

@ -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;
}