Lines Matching defs:LCA

290 // LCA is a current notion of LCA, to be raised above 'this'.
291 // As a convenient boundary condition, return 'this' if LCA is NULL.
292 // Find the LCA of those two nodes.
293 Block* Block::dom_lca(Block* LCA) {
294 if (LCA == NULL || LCA == this) return this;
297 while (anc->_dom_depth > LCA->_dom_depth)
298 anc = anc->_idom; // Walk up till anc is as high as LCA
300 while (LCA->_dom_depth > anc->_dom_depth)
301 LCA = LCA->_idom; // Walk up till LCA is as high as anc
303 while (LCA != anc) { // Walk both up till they are the same
304 LCA = LCA->_idom;
308 return LCA;
313 // The definition must dominate the use, so move the LCA upward in the
315 // the LCA only with the phi input paths which actually use this def.
316 static Block* raise_LCA_above_use(Block* LCA, Node* use, Node* def, Block_Array &bbs) {
318 if (buse == NULL) return LCA; // Unused killing Projs have no use block
319 if (!use->is_Phi()) return buse->dom_lca(LCA);
333 LCA = pred->dom_lca(LCA);
336 return LCA;
340 // Return a new LCA that dominates LCA and any of its marked predecessors.
342 // which are marked with the given index. Return the LCA (in the dom tree)
344 // LCA.
345 static Block* raise_LCA_above_marks(Block* LCA, node_idx_t mark,
348 worklist.push(LCA);
356 // Don't process the current LCA, otherwise the search may terminate early
357 if (mid != LCA && mid->raise_LCA_mark() == mark) {
358 // Raise the LCA.
359 LCA = mid->dom_lca(LCA);
360 if (LCA == early) break; // stop searching everywhere
361 assert(early->dominates(LCA), "early is high enough");
363 worklist.push(LCA);
364 if (LCA == mid)
375 return LCA;
434 // from the load to the store, or else move LCA upward to force the
440 // Return the (updated) LCA. There will not be any possibly interfering
441 // store between the load's "early block" and the updated LCA.
442 // Any stores in the updated LCA will have new precedence edges
444 // in the LCA, in which case the precedence edges will make LCM
446 // above the LCA, if it is not the early block.
447 Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
449 assert(LCA != NULL, "");
450 DEBUG_ONLY(Block* LCA_orig = LCA);
481 return LCA;
630 // Instead of finding the LCA of all inputs to a Phi that match 'mem',
651 LCA = early; // but can not schedule below 'early'
670 // 'store' is between the current LCA and earliest possible block.
671 // Label its block, and decide later on how to raise the LCA
672 // to include the effect on LCA of this store.
673 // If this store's block gets chosen as the raised LCA, we
676 // (But, don't bother if LCA is already raised all the way.)
677 if (LCA != early) {
692 LCA = early;
701 if (LCA == early) return LCA;
704 // in the load's 'early' block. Move LCA up above all predecessors
707 // The raised LCA block can be a home to such interfering stores,
710 // The raised LCA will be a lower bound for placing the load,
714 LCA = raise_LCA_above_marks(LCA, load->_idx, early, _bbs);
715 if (LCA == early) return LCA;
718 // in the non-early LCA block.
720 if (LCA->raise_LCA_mark() == load_index) {
724 if (store_block == LCA) {
734 // Any other stores we found must be either inside the new LCA
735 // or else outside the original LCA. In the latter case, they
737 assert(LCA->dominates(store_block)
745 return LCA;
1011 // Pick a block for node self, between early and LCA, that is a cheaper
1012 // alternative to LCA.
1013 Block* PhaseCFG::hoist_to_cheaper_block(Block* LCA, Block* early, Node* self) {
1015 Block* least = LCA;
1018 uint start_latency = _node_latency->at_grow(LCA->_nodes[0]->_idx);
1019 uint end_latency = _node_latency->at_grow(LCA->_nodes[LCA->end_idx()]->_idx);
1040 LCA->_pre_order,
1041 LCA->_nodes[0]->_idx,
1043 LCA->_nodes[LCA->end_idx()]->_idx,
1049 // Walk up the dominator tree from LCA (Lowest common ancestor) to
1051 while (LCA != early) {
1052 LCA = LCA->_idom; // Follow up the dominator tree
1054 if (LCA == NULL) {
1056 C->record_method_not_compilable("late schedule failed: LCA == NULL");
1061 if (mach && LCA == root_block)
1064 uint start_lat = _node_latency->at_grow(LCA->_nodes[0]->_idx);
1065 uint end_idx = LCA->end_idx();
1066 uint end_lat = _node_latency->at_grow(LCA->_nodes[end_idx]->_idx);
1067 double LCA_freq = LCA->_freq;
1071 LCA->_pre_order, LCA->_nodes[0]->_idx, start_lat, end_idx, end_lat, LCA_freq);
1082 least = LCA; // Found cheaper block
1114 // Now schedule all codes as LATE as possible. This is the LCA in the
1171 // Gather LCA of all uses
1172 Block *LCA = NULL;
1175 // For all uses, find LCA
1177 LCA = raise_LCA_above_use(LCA, use, self, _bbs);
1185 _bbs.map(self->_idx, LCA);
1186 LCA->add_inst(self);
1192 // Hoist LCA above possible-defs and insert anti-dependences to
1193 // defs in new LCA block.
1194 LCA = insert_anti_dependences(LCA, self);
1197 if (early->_dom_depth > LCA->_dom_depth) {
1198 // Somehow the LCA has moved above the earliest legal point.
1206 // Bailout without retry when (early->_dom_depth > LCA->_dom_depth)
1213 bool try_to_hoist = (LCA != early);
1228 late = hoist_to_cheaper_block(LCA, early, self);
1230 // Just use the LCA of the uses.
1231 late = LCA;
1292 // Now schedule all codes as LATE as possible. This is the LCA in the