src/share/vm/opto/cfgnode.cpp

Print this page
rev 3898 : 8005031: Some cleanup in c2 to prepare for incremental inlining support
Summary: collection of small changes to prepare for incremental inlining.
Reviewed-by:


1549     return NULL;                // No change
1550 
1551   Node *top = phase->C->top();
1552   bool new_phi = (outcnt() == 0); // transforming new Phi
1553   // No change for igvn if new phi is not hooked
1554   if (new_phi && can_reshape)
1555     return NULL;
1556 
1557   // The are 2 situations when only one valid phi's input is left
1558   // (in addition to Region input).
1559   // One: region is not loop - replace phi with this input.
1560   // Two: region is loop - replace phi with top since this data path is dead
1561   //                       and we need to break the dead data loop.
1562   Node* progress = NULL;        // Record if any progress made
1563   for( uint j = 1; j < req(); ++j ){ // For all paths in
1564     // Check unreachable control paths
1565     Node* rc = r->in(j);
1566     Node* n = in(j);            // Get the input
1567     if (rc == NULL || phase->type(rc) == Type::TOP) {
1568       if (n != top) {           // Not already top?




1569         set_req(j, top);        // Nuke it down
1570         progress = this;        // Record progress
1571       }
1572     }
1573   }
1574 
1575   if (can_reshape && outcnt() == 0) {
1576     // set_req() above may kill outputs if Phi is referenced
1577     // only by itself on the dead (top) control path.
1578     return top;
1579   }
1580 
1581   Node* uin = unique_input(phase);
1582   if (uin == top) {             // Simplest case: no alive inputs.
1583     if (can_reshape)            // IGVN transformation
1584       return top;
1585     else
1586       return NULL;              // Identity will return TOP
1587   } else if (uin != NULL) {
1588     // Only one not-NULL unique input path is left.




1549     return NULL;                // No change
1550 
1551   Node *top = phase->C->top();
1552   bool new_phi = (outcnt() == 0); // transforming new Phi
1553   // No change for igvn if new phi is not hooked
1554   if (new_phi && can_reshape)
1555     return NULL;
1556 
1557   // The are 2 situations when only one valid phi's input is left
1558   // (in addition to Region input).
1559   // One: region is not loop - replace phi with this input.
1560   // Two: region is loop - replace phi with top since this data path is dead
1561   //                       and we need to break the dead data loop.
1562   Node* progress = NULL;        // Record if any progress made
1563   for( uint j = 1; j < req(); ++j ){ // For all paths in
1564     // Check unreachable control paths
1565     Node* rc = r->in(j);
1566     Node* n = in(j);            // Get the input
1567     if (rc == NULL || phase->type(rc) == Type::TOP) {
1568       if (n != top) {           // Not already top?
1569         PhaseIterGVN *igvn = phase->is_IterGVN();
1570         if (can_reshape && igvn != NULL) {
1571           igvn->_worklist.push(r);
1572         }
1573         set_req(j, top);        // Nuke it down
1574         progress = this;        // Record progress
1575       }
1576     }
1577   }
1578 
1579   if (can_reshape && outcnt() == 0) {
1580     // set_req() above may kill outputs if Phi is referenced
1581     // only by itself on the dead (top) control path.
1582     return top;
1583   }
1584 
1585   Node* uin = unique_input(phase);
1586   if (uin == top) {             // Simplest case: no alive inputs.
1587     if (can_reshape)            // IGVN transformation
1588       return top;
1589     else
1590       return NULL;              // Identity will return TOP
1591   } else if (uin != NULL) {
1592     // Only one not-NULL unique input path is left.