comparison src/share/vm/opto/memnode.cpp @ 11044:3aa636f2a743

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
author adlertz
date Tue, 25 Jun 2013 12:07:07 -0700
parents b88209cf98c0
children edb5ab0f3fe5 7944aba7ba41
comparison
equal deleted inserted replaced
11043:a023da4ffc15 11044:3aa636f2a743
2941 if ((opc == Op_MemBarAcquire || opc == Op_MemBarVolatile)) { 2941 if ((opc == Op_MemBarAcquire || opc == Op_MemBarVolatile)) {
2942 // Volatile field loads and stores. 2942 // Volatile field loads and stores.
2943 Node* my_mem = in(MemBarNode::Precedent); 2943 Node* my_mem = in(MemBarNode::Precedent);
2944 // The MembarAquire may keep an unused LoadNode alive through the Precedent edge 2944 // The MembarAquire may keep an unused LoadNode alive through the Precedent edge
2945 if ((my_mem != NULL) && (opc == Op_MemBarAcquire) && (my_mem->outcnt() == 1)) { 2945 if ((my_mem != NULL) && (opc == Op_MemBarAcquire) && (my_mem->outcnt() == 1)) {
2946 assert(my_mem->unique_out() == this, "sanity"); 2946 // if the Precedent is a decodeN and its input (a Load) is used at more than one place,
2947 phase->hash_delete(this); 2947 // replace this Precedent (decodeN) with the Load instead.
2948 del_req(Precedent); 2948 if ((my_mem->Opcode() == Op_DecodeN) && (my_mem->in(1)->outcnt() > 1)) {
2949 phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later 2949 Node* load_node = my_mem->in(1);
2950 my_mem = NULL; 2950 set_req(MemBarNode::Precedent, load_node);
2951 phase->is_IterGVN()->_worklist.push(my_mem);
2952 my_mem = load_node;
2953 } else {
2954 assert(my_mem->unique_out() == this, "sanity");
2955 del_req(Precedent);
2956 phase->is_IterGVN()->_worklist.push(my_mem); // remove dead node later
2957 my_mem = NULL;
2958 }
2951 } 2959 }
2952 if (my_mem != NULL && my_mem->is_Mem()) { 2960 if (my_mem != NULL && my_mem->is_Mem()) {
2953 const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr(); 2961 const TypeOopPtr* t_oop = my_mem->in(MemNode::Address)->bottom_type()->isa_oopptr();
2954 // Check for scalar replaced object reference. 2962 // Check for scalar replaced object reference.
2955 if( t_oop != NULL && t_oop->is_known_instance_field() && 2963 if( t_oop != NULL && t_oop->is_known_instance_field() &&