提交 ead49ab5 编写于 作者: K kvn

6667573: Use set_req_X() in AddPNode::Ideal() for Iterative GVN

Summary: set_req_X() puts dependent nodes on IGVN worklist which allows to improve graph and gives more opportunities for EA scalar replacement.
Reviewed-by: jrose, never
上级 6dc566b7
......@@ -505,15 +505,25 @@ Node *AddPNode::Ideal(PhaseGVN *phase, bool can_reshape) {
const Type *temp_t2 = phase->type( in(Offset) );
if( temp_t2 == Type::TOP ) return NULL;
const TypeX *t2 = temp_t2->is_intptr_t();
Node* address;
Node* offset;
if( t2->is_con() ) {
// The Add of the flattened expression
set_req(Address, addp->in(Address));
set_req(Offset , phase->MakeConX(t2->get_con() + t12->get_con()));
return this; // Made progress
address = addp->in(Address);
offset = phase->MakeConX(t2->get_con() + t12->get_con());
} else {
// Else move the constant to the right. ((A+con)+B) into ((A+B)+con)
address = phase->transform(new (phase->C, 4) AddPNode(in(Base),addp->in(Address),in(Offset)));
offset = addp->in(Offset);
}
PhaseIterGVN *igvn = phase->is_IterGVN();
if( igvn ) {
set_req_X(Address,address,igvn);
set_req_X(Offset,offset,igvn);
} else {
set_req(Address,address);
set_req(Offset,offset);
}
// Else move the constant to the right. ((A+con)+B) into ((A+B)+con)
set_req(Address, phase->transform(new (phase->C, 4) AddPNode(in(Base),addp->in(Address),in(Offset))));
set_req(Offset , addp->in(Offset));
return this;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册