hotspot/src/share/vm/opto/cfgnode.cpp
changeset 4016 9c11d6d519f7
parent 3603 2d6d87c8705f
child 5120 c733ad68de42
child 5537 c075180330cf
equal deleted inserted replaced
4015:fee7000abec2 4016:9c11d6d519f7
  1529   // This means we have to use type_or_null to defend against untyped regions.
  1529   // This means we have to use type_or_null to defend against untyped regions.
  1530   if( phase->type_or_null(r) == Type::TOP ) // Dead code?
  1530   if( phase->type_or_null(r) == Type::TOP ) // Dead code?
  1531     return NULL;                // No change
  1531     return NULL;                // No change
  1532 
  1532 
  1533   Node *top = phase->C->top();
  1533   Node *top = phase->C->top();
       
  1534   bool new_phi = (outcnt() == 0); // transforming new Phi
       
  1535   assert(!can_reshape || !new_phi, "for igvn new phi should be hooked");
  1534 
  1536 
  1535   // The are 2 situations when only one valid phi's input is left
  1537   // The are 2 situations when only one valid phi's input is left
  1536   // (in addition to Region input).
  1538   // (in addition to Region input).
  1537   // One: region is not loop - replace phi with this input.
  1539   // One: region is not loop - replace phi with this input.
  1538   // Two: region is loop - replace phi with top since this data path is dead
  1540   // Two: region is loop - replace phi with top since this data path is dead
  1546       if (n != top) {           // Not already top?
  1548       if (n != top) {           // Not already top?
  1547         set_req(j, top);        // Nuke it down
  1549         set_req(j, top);        // Nuke it down
  1548         progress = this;        // Record progress
  1550         progress = this;        // Record progress
  1549       }
  1551       }
  1550     }
  1552     }
       
  1553   }
       
  1554 
       
  1555   if (can_reshape && outcnt() == 0) {
       
  1556     // set_req() above may kill outputs if Phi is referenced
       
  1557     // only by itself on the dead (top) control path.
       
  1558     return top;
  1551   }
  1559   }
  1552 
  1560 
  1553   Node* uin = unique_input(phase);
  1561   Node* uin = unique_input(phase);
  1554   if (uin == top) {             // Simplest case: no alive inputs.
  1562   if (uin == top) {             // Simplest case: no alive inputs.
  1555     if (can_reshape)            // IGVN transformation
  1563     if (can_reshape)            // IGVN transformation
  1682             // compress paths and change unreachable cycles to TOP
  1690             // compress paths and change unreachable cycles to TOP
  1683             // If not, we can update the input infinitely along a MergeMem cycle
  1691             // If not, we can update the input infinitely along a MergeMem cycle
  1684             // Equivalent code is in MemNode::Ideal_common
  1692             // Equivalent code is in MemNode::Ideal_common
  1685             Node *m  = phase->transform(n);
  1693             Node *m  = phase->transform(n);
  1686             if (outcnt() == 0) {  // Above transform() may kill us!
  1694             if (outcnt() == 0) {  // Above transform() may kill us!
  1687               progress = phase->C->top();
  1695               return top;
  1688               break;
       
  1689             }
  1696             }
  1690             // If transformed to a MergeMem, get the desired slice
  1697             // If transformed to a MergeMem, get the desired slice
  1691             // Otherwise the returned node represents memory for every slice
  1698             // Otherwise the returned node represents memory for every slice
  1692             Node *new_mem = (m->is_MergeMem()) ?
  1699             Node *new_mem = (m->is_MergeMem()) ?
  1693                              m->as_MergeMem()->memory_at(alias_idx) : m;
  1700                              m->as_MergeMem()->memory_at(alias_idx) : m;