src/hotspot/share/opto/loopnode.cpp
changeset 58471 bada0782842a
parent 58354 e6b5ec45ab9e
child 58516 d376d86b0a01
equal deleted inserted replaced
58470:8991796c17d4 58471:bada0782842a
  4047   // instructions and for rescheduling the load.  The users of the memory
  4047   // instructions and for rescheduling the load.  The users of the memory
  4048   // input of this load are examined.  Any use which is not a load and is
  4048   // input of this load are examined.  Any use which is not a load and is
  4049   // dominated by early is considered a potentially interfering store.
  4049   // dominated by early is considered a potentially interfering store.
  4050   // This can produce false positives.
  4050   // This can produce false positives.
  4051   if (n->is_Load() && LCA != early) {
  4051   if (n->is_Load() && LCA != early) {
  4052     Node_List worklist;
  4052     int load_alias_idx = C->get_alias_index(n->adr_type());
  4053 
  4053     if (C->alias_type(load_alias_idx)->is_rewritable()) {
  4054     Node *mem = n->in(MemNode::Memory);
  4054 
  4055     for (DUIterator_Fast imax, i = mem->fast_outs(imax); i < imax; i++) {
  4055       Node_List worklist;
  4056       Node* s = mem->fast_out(i);
  4056 
  4057       worklist.push(s);
  4057       Node *mem = n->in(MemNode::Memory);
  4058     }
  4058       for (DUIterator_Fast imax, i = mem->fast_outs(imax); i < imax; i++) {
  4059     while(worklist.size() != 0 && LCA != early) {
  4059         Node* s = mem->fast_out(i);
  4060       Node* s = worklist.pop();
  4060         worklist.push(s);
  4061       if (s->is_Load() || s->Opcode() == Op_SafePoint ||
  4061       }
  4062           (s->is_CallStaticJava() && s->as_CallStaticJava()->uncommon_trap_request() != 0)) {
  4062       while(worklist.size() != 0 && LCA != early) {
  4063         continue;
  4063         Node* s = worklist.pop();
  4064       } else if (s->is_MergeMem()) {
  4064         if (s->is_Load() || s->Opcode() == Op_SafePoint ||
  4065         for (DUIterator_Fast imax, i = s->fast_outs(imax); i < imax; i++) {
  4065             (s->is_CallStaticJava() && s->as_CallStaticJava()->uncommon_trap_request() != 0)) {
  4066           Node* s1 = s->fast_out(i);
  4066           continue;
  4067           worklist.push(s1);
  4067         } else if (s->is_MergeMem()) {
  4068         }
  4068           for (DUIterator_Fast imax, i = s->fast_outs(imax); i < imax; i++) {
  4069       } else {
  4069             Node* s1 = s->fast_out(i);
  4070         Node *sctrl = has_ctrl(s) ? get_ctrl(s) : s->in(0);
  4070             worklist.push(s1);
  4071         assert(sctrl != NULL || s->outcnt() == 0, "must have control");
  4071           }
  4072         if (sctrl != NULL && !sctrl->is_top() && is_dominator(early, sctrl)) {
  4072         } else {
  4073           LCA = dom_lca_for_get_late_ctrl(LCA, sctrl, n);
  4073           Node *sctrl = has_ctrl(s) ? get_ctrl(s) : s->in(0);
       
  4074           assert(sctrl != NULL || s->outcnt() == 0, "must have control");
       
  4075           if (sctrl != NULL && !sctrl->is_top() && C->can_alias(s->adr_type(), load_alias_idx) && is_dominator(early, sctrl)) {
       
  4076             LCA = dom_lca_for_get_late_ctrl(LCA, sctrl, n);
       
  4077           }
  4074         }
  4078         }
  4075       }
  4079       }
  4076     }
  4080     }
  4077   }
  4081   }
  4078 
  4082