604 DEBUG_ONLY(found_match = true); |
604 DEBUG_ONLY(found_match = true); |
605 Block* pred_block = _bbs[store_block->pred(j)->_idx]; |
605 Block* pred_block = _bbs[store_block->pred(j)->_idx]; |
606 if (pred_block != early) { |
606 if (pred_block != early) { |
607 // If any predecessor of the Phi matches the load's "early block", |
607 // If any predecessor of the Phi matches the load's "early block", |
608 // we do not need a precedence edge between the Phi and 'load' |
608 // we do not need a precedence edge between the Phi and 'load' |
609 // since the load will be forced into a block preceeding the Phi. |
609 // since the load will be forced into a block preceding the Phi. |
610 pred_block->set_raise_LCA_mark(load_index); |
610 pred_block->set_raise_LCA_mark(load_index); |
611 assert(!LCA_orig->dominates(pred_block) || |
611 assert(!LCA_orig->dominates(pred_block) || |
612 early->dominates(pred_block), "early is high enough"); |
612 early->dominates(pred_block), "early is high enough"); |
613 must_raise_LCA = true; |
613 must_raise_LCA = true; |
614 } |
614 } |
1650 // Can only reach here if called after lcm. The original Op_If is gone, |
1650 // Can only reach here if called after lcm. The original Op_If is gone, |
1651 // so we attempt to infer the probability from one or both of the |
1651 // so we attempt to infer the probability from one or both of the |
1652 // successor blocks. |
1652 // successor blocks. |
1653 assert(_num_succs == 2, "expecting 2 successors of a null check"); |
1653 assert(_num_succs == 2, "expecting 2 successors of a null check"); |
1654 // If either successor has only one predecessor, then the |
1654 // If either successor has only one predecessor, then the |
1655 // probabiltity estimate can be derived using the |
1655 // probability estimate can be derived using the |
1656 // relative frequency of the successor and this block. |
1656 // relative frequency of the successor and this block. |
1657 if (_succs[i]->num_preds() == 2) { |
1657 if (_succs[i]->num_preds() == 2) { |
1658 return _succs[i]->_freq / _freq; |
1658 return _succs[i]->_freq / _freq; |
1659 } else if (_succs[1-i]->num_preds() == 2) { |
1659 } else if (_succs[1-i]->num_preds() == 2) { |
1660 return 1 - (_succs[1-i]->_freq / _freq); |
1660 return 1 - (_succs[1-i]->_freq / _freq); |
1852 |
1852 |
1853 n->as_MachIf()->_prob = p; |
1853 n->as_MachIf()->_prob = p; |
1854 } |
1854 } |
1855 |
1855 |
1856 //------------------------------update_succ_freq------------------------------- |
1856 //------------------------------update_succ_freq------------------------------- |
1857 // Update the appropriate frequency associated with block 'b', a succesor of |
1857 // Update the appropriate frequency associated with block 'b', a successor of |
1858 // a block in this loop. |
1858 // a block in this loop. |
1859 void CFGLoop::update_succ_freq(Block* b, float freq) { |
1859 void CFGLoop::update_succ_freq(Block* b, float freq) { |
1860 if (b->_loop == this) { |
1860 if (b->_loop == this) { |
1861 if (b == head()) { |
1861 if (b == head()) { |
1862 // back branch within the loop |
1862 // back branch within the loop |