提交 5c43e586 编写于 作者: A adlertz

8017243: 8001345 is incomplete

Summary: Replaces unused decodeN at MemBarAcquire with its corresponding loadN if loadN is used at more than one place.
Reviewed-by: kvn, twisti
上级 cc73d932
...@@ -2943,11 +2943,19 @@ Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) { ...@@ -2943,11 +2943,19 @@ Node *MemBarNode::Ideal(PhaseGVN *phase, bool can_reshape) {
Node* my_mem = in(MemBarNode::Precedent); Node* my_mem = in(MemBarNode::Precedent);
// The MembarAquire may keep an unused LoadNode alive through the Precedent edge // The MembarAquire may keep an unused LoadNode alive through the Precedent edge
if ((my_mem != NULL) && (opc == Op_MemBarAcquire) && (my_mem->outcnt() == 1)) { if ((my_mem != NULL) && (opc == Op_MemBarAcquire) && (my_mem->outcnt() == 1)) {
assert(my_mem->unique_out() == this, "sanity"); // if the Precedent is a decodeN and its input (a Load) is used at more than one place,
phase->hash_delete(this); // replace this Precedent (decodeN) with the Load instead.
del_req(Precedent); if ((my_mem->Opcode() == Op_DecodeN) && (my_mem->in(1)->outcnt() > 1)) {
phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later Node* load_node = my_mem->in(1);
my_mem = NULL; set_req(MemBarNode::Precedent, load_node);
phase->is_IterGVN()->_worklist.push(my_mem);
my_mem = load_node;
} else {
assert(my_mem->unique_out() == this, "sanity");
del_req(Precedent);
phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later
my_mem = NULL;
}
} }
if (my_mem != NULL && my_mem->is_Mem()) { if (my_mem != NULL && my_mem->is_Mem()) {
const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr(); const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册