src/share/vm/opto/loopopts.cpp

Print this page




1376     Node* nnn = old_new[old->_idx];
1377     // Copy uses to a worklist, so I can munge the def-use info
1378     // with impunity.
1379     for (DUIterator_Fast jmax, j = old->fast_outs(jmax); j < jmax; j++)
1380       worklist.push(old->fast_out(j));
1381 
1382     while( worklist.size() ) {
1383       Node *use = worklist.pop();
1384       if (!has_node(use))  continue; // Ignore dead nodes
1385       if (use->in(0) == C->top())  continue;
1386       IdealLoopTree *use_loop = get_loop( has_ctrl(use) ? get_ctrl(use) : use );
1387       // Check for data-use outside of loop - at least one of OLD or USE
1388       // must not be a CFG node.
1389       if( !loop->is_member( use_loop ) && (!old->is_CFG() || !use->is_CFG())) {
1390 
1391         // If the Data use is an IF, that means we have an IF outside of the
1392         // loop that is switching on a condition that is set inside of the
1393         // loop.  Happens if people set a loop-exit flag; then test the flag
1394         // in the loop to break the loop, then test is again outside of the
1395         // loop to determine which way the loop exited.
1396         if( use->is_If() || use->is_CMove() ) {

1397           // Since this code is highly unlikely, we lazily build the worklist
1398           // of such Nodes to go split.
1399           if( !split_if_set )
1400             split_if_set = new Node_List(area);
1401           split_if_set->push(use);
1402         }
1403         if( use->is_Bool() ) {
1404           if( !split_bool_set )
1405             split_bool_set = new Node_List(area);
1406           split_bool_set->push(use);
1407         }
1408         if( use->Opcode() == Op_CreateEx ) {
1409           if( !split_cex_set )
1410             split_cex_set = new Node_List(area);
1411           split_cex_set->push(use);
1412         }
1413 
1414 
1415         // Get "block" use is in
1416         uint idx = 0;




1376     Node* nnn = old_new[old->_idx];
1377     // Copy uses to a worklist, so I can munge the def-use info
1378     // with impunity.
1379     for (DUIterator_Fast jmax, j = old->fast_outs(jmax); j < jmax; j++)
1380       worklist.push(old->fast_out(j));
1381 
1382     while( worklist.size() ) {
1383       Node *use = worklist.pop();
1384       if (!has_node(use))  continue; // Ignore dead nodes
1385       if (use->in(0) == C->top())  continue;
1386       IdealLoopTree *use_loop = get_loop( has_ctrl(use) ? get_ctrl(use) : use );
1387       // Check for data-use outside of loop - at least one of OLD or USE
1388       // must not be a CFG node.
1389       if( !loop->is_member( use_loop ) && (!old->is_CFG() || !use->is_CFG())) {
1390 
1391         // If the Data use is an IF, that means we have an IF outside of the
1392         // loop that is switching on a condition that is set inside of the
1393         // loop.  Happens if people set a loop-exit flag; then test the flag
1394         // in the loop to break the loop, then test is again outside of the
1395         // loop to determine which way the loop exited.
1396         // Loop predicate If node connects to Bool node through Opaque1 node.
1397         if (use->is_If() || use->is_CMove() || C->is_predicate_opaq(use)) {
1398           // Since this code is highly unlikely, we lazily build the worklist
1399           // of such Nodes to go split.
1400           if( !split_if_set )
1401             split_if_set = new Node_List(area);
1402           split_if_set->push(use);
1403         }
1404         if( use->is_Bool() ) {
1405           if( !split_bool_set )
1406             split_bool_set = new Node_List(area);
1407           split_bool_set->push(use);
1408         }
1409         if( use->Opcode() == Op_CreateEx ) {
1410           if( !split_cex_set )
1411             split_cex_set = new Node_List(area);
1412           split_cex_set->push(use);
1413         }
1414 
1415 
1416         // Get "block" use is in
1417         uint idx = 0;