< prev index next >

src/share/vm/opto/ifnode.cpp

Print this page




1441     tty->print("   Removing IfNode: "); this->dump();
1442   }
1443   if (VerifyOpto && !igvn->allow_progress()) {
1444     // Found an equivalent dominating test,
1445     // we can not guarantee reaching a fix-point for these during iterativeGVN
1446     // since intervening nodes may not change.
1447     return NULL;
1448   }
1449 #endif
1450 
1451   igvn->hash_delete(this);      // Remove self to prevent spurious V-N
1452   Node *idom = in(0);
1453   // Need opcode to decide which way 'this' test goes
1454   int prev_op = prev_dom->Opcode();
1455   Node *top = igvn->C->top(); // Shortcut to top
1456 
1457   // Loop predicates may have depending checks which should not
1458   // be skipped. For example, range check predicate has two checks
1459   // for lower and upper bounds.
1460   ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
1461   if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL)
1462    prev_dom = idom;

1463 
1464   // Now walk the current IfNode's projections.
1465   // Loop ends when 'this' has no more uses.
1466   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; --i) {
1467     Node *ifp = last_out(i);     // Get IfTrue/IfFalse
1468     igvn->add_users_to_worklist(ifp);
1469     // Check which projection it is and set target.
1470     // Data-target is either the dominating projection of the same type
1471     // or TOP if the dominating projection is of opposite type.
1472     // Data-target will be used as the new control edge for the non-CFG
1473     // nodes like Casts and Loads.
1474     Node *data_target = (ifp->Opcode() == prev_op) ? prev_dom : top;
1475     // Control-target is just the If's immediate dominator or TOP.
1476     Node *ctrl_target = (ifp->Opcode() == prev_op) ?     idom : top;
1477 
1478     // For each child of an IfTrue/IfFalse projection, reroute.
1479     // Loop ends when projection has no more uses.
1480     for (DUIterator_Last jmin, j = ifp->last_outs(jmin); j >= jmin; --j) {
1481       Node* s = ifp->last_out(j);   // Get child of IfTrue/IfFalse
1482       if( !s->depends_only_on_test() ) {




1441     tty->print("   Removing IfNode: "); this->dump();
1442   }
1443   if (VerifyOpto && !igvn->allow_progress()) {
1444     // Found an equivalent dominating test,
1445     // we can not guarantee reaching a fix-point for these during iterativeGVN
1446     // since intervening nodes may not change.
1447     return NULL;
1448   }
1449 #endif
1450 
1451   igvn->hash_delete(this);      // Remove self to prevent spurious V-N
1452   Node *idom = in(0);
1453   // Need opcode to decide which way 'this' test goes
1454   int prev_op = prev_dom->Opcode();
1455   Node *top = igvn->C->top(); // Shortcut to top
1456 
1457   // Loop predicates may have depending checks which should not
1458   // be skipped. For example, range check predicate has two checks
1459   // for lower and upper bounds.
1460   ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
1461   if ((unc_proj != NULL) && (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL)) {
1462     prev_dom = idom;
1463   }
1464 
1465   // Now walk the current IfNode's projections.
1466   // Loop ends when 'this' has no more uses.
1467   for (DUIterator_Last imin, i = last_outs(imin); i >= imin; --i) {
1468     Node *ifp = last_out(i);     // Get IfTrue/IfFalse
1469     igvn->add_users_to_worklist(ifp);
1470     // Check which projection it is and set target.
1471     // Data-target is either the dominating projection of the same type
1472     // or TOP if the dominating projection is of opposite type.
1473     // Data-target will be used as the new control edge for the non-CFG
1474     // nodes like Casts and Loads.
1475     Node *data_target = (ifp->Opcode() == prev_op) ? prev_dom : top;
1476     // Control-target is just the If's immediate dominator or TOP.
1477     Node *ctrl_target = (ifp->Opcode() == prev_op) ?     idom : top;
1478 
1479     // For each child of an IfTrue/IfFalse projection, reroute.
1480     // Loop ends when projection has no more uses.
1481     for (DUIterator_Last jmin, j = ifp->last_outs(jmin); j >= jmin; --j) {
1482       Node* s = ifp->last_out(j);   // Get child of IfTrue/IfFalse
1483       if( !s->depends_only_on_test() ) {


< prev index next >