< prev index next >

src/hotspot/share/opto/loopopts.cpp

Print this page




1401             x_ctrl = place_near_use(x_ctrl);
1402 
1403             if (bs->sink_node(this, n, x, x_ctrl, n_ctrl)) {
1404               continue;
1405             }
1406 
1407             if (n->is_Load()) {
1408               // For loads, add a control edge to a CFG node outside of the loop
1409               // to force them to not combine and return back inside the loop
1410               // during GVN optimization (4641526).
1411               //
1412               // Because we are setting the actual control input, factor in
1413               // the result from get_late_ctrl() so we respect any
1414               // anti-dependences. (6233005).
1415               x_ctrl = dom_lca(late_load_ctrl, x_ctrl);
1416 
1417               // Don't allow the control input to be a CFG splitting node.
1418               // Such nodes should only have ProjNodes as outs, e.g. IfNode
1419               // should only have IfTrueNode and IfFalseNode (4985384).
1420               x_ctrl = find_non_split_ctrl(x_ctrl);













1421               assert(dom_depth(n_ctrl) <= dom_depth(x_ctrl), "n is later than its clone");
1422 
1423               x->set_req(0, x_ctrl);
1424             }
1425             register_new_node(x, x_ctrl);
1426 
1427             // Some institutional knowledge is needed here: 'x' is
1428             // yanked because if the optimizer runs GVN on it all the
1429             // cloned x's will common up and undo this optimization and
1430             // be forced back in the loop.
1431             // I tried setting control edges on the x's to force them to
1432             // not combine, but the matching gets worried when it tries
1433             // to fold a StoreP and an AddP together (as part of an
1434             // address expression) and the AddP and StoreP have
1435             // different controls.
1436             if (!x->is_Load() && !x->is_DecodeNarrowPtr()) _igvn._worklist.yank(x);
1437           }
1438           _igvn.remove_dead_node(n);
1439         }
1440       }




1401             x_ctrl = place_near_use(x_ctrl);
1402 
1403             if (bs->sink_node(this, n, x, x_ctrl, n_ctrl)) {
1404               continue;
1405             }
1406 
1407             if (n->is_Load()) {
1408               // For loads, add a control edge to a CFG node outside of the loop
1409               // to force them to not combine and return back inside the loop
1410               // during GVN optimization (4641526).
1411               //
1412               // Because we are setting the actual control input, factor in
1413               // the result from get_late_ctrl() so we respect any
1414               // anti-dependences. (6233005).
1415               x_ctrl = dom_lca(late_load_ctrl, x_ctrl);
1416 
1417               // Don't allow the control input to be a CFG splitting node.
1418               // Such nodes should only have ProjNodes as outs, e.g. IfNode
1419               // should only have IfTrueNode and IfFalseNode (4985384).
1420               x_ctrl = find_non_split_ctrl(x_ctrl);
1421               
1422               IdealLoopTree* x_loop = get_loop(x_ctrl);
1423               if (x_loop->_head->is_OuterStripMinedLoop() && is_dominator(n_ctrl, x_loop->_head)) {
1424                 // Anti dependence analysis is sometimes too
1425                 // conservative: a store in the outer strip mined loop
1426                 // can prevent a load from floating out of the outer
1427                 // strip mined loop but the load may not be referenced
1428                 // from the safepoint: loop strip mining verification
1429                 // code reports a problem in that case. Make sure the
1430                 // load is not moved in the outer strip mined loop in
1431                 // that case.
1432                 x_ctrl = x_loop->_head->in(LoopNode::EntryControl);
1433               }
1434               assert(dom_depth(n_ctrl) <= dom_depth(x_ctrl), "n is later than its clone");
1435 
1436               x->set_req(0, x_ctrl);
1437             }
1438             register_new_node(x, x_ctrl);
1439 
1440             // Some institutional knowledge is needed here: 'x' is
1441             // yanked because if the optimizer runs GVN on it all the
1442             // cloned x's will common up and undo this optimization and
1443             // be forced back in the loop.
1444             // I tried setting control edges on the x's to force them to
1445             // not combine, but the matching gets worried when it tries
1446             // to fold a StoreP and an AddP together (as part of an
1447             // address expression) and the AddP and StoreP have
1448             // different controls.
1449             if (!x->is_Load() && !x->is_DecodeNarrowPtr()) _igvn._worklist.yank(x);
1450           }
1451           _igvn.remove_dead_node(n);
1452         }
1453       }


< prev index next >