221 // If I dont have a reachable TRUE and FALSE path following the IfNode then
222 // I can assume this path reaches an infinite loop. In this case it's not
223 // important to optimize the data Nodes - either the whole compilation will
224 // be tossed or this path (and all data Nodes) will go dead.
225 if (iff->outcnt() != 2) return;
226
227 // Make control-dependent data Nodes on the live path (path that will remain
228 // once the dominated IF is removed) become control-dependent on the
229 // dominating projection.
230 Node* dp = iff->as_If()->proj_out(pop == Op_IfTrue);
231
232 // Loop predicates may have depending checks which should not
233 // be skipped. For example, range check predicate has two checks
234 // for lower and upper bounds.
235 if (dp == NULL)
236 return;
237
238 ProjNode* dp_proj = dp->as_Proj();
239 ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp_proj->_con)->as_Proj();
240 if (exclude_loop_predicate &&
241 is_uncommon_trap_proj(unc_proj, Deoptimization::Reason_predicate))
242 return; // Let IGVN transformation change control dependence.
243
244 IdealLoopTree *old_loop = get_loop(dp);
245
246 for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) {
247 Node* cd = dp->fast_out(i); // Control-dependent node
248 if (cd->depends_only_on_test()) {
249 assert(cd->in(0) == dp, "");
250 _igvn.replace_input_of(cd, 0, prevdom);
251 set_early_ctrl(cd);
252 IdealLoopTree *new_loop = get_loop(get_ctrl(cd));
253 if (old_loop != new_loop) {
254 if (!old_loop->_child) old_loop->_body.yank(cd);
255 if (!new_loop->_child) new_loop->_body.push(cd);
256 }
257 --i;
258 --imax;
259 }
260 }
261 }
|
221 // If I dont have a reachable TRUE and FALSE path following the IfNode then
222 // I can assume this path reaches an infinite loop. In this case it's not
223 // important to optimize the data Nodes - either the whole compilation will
224 // be tossed or this path (and all data Nodes) will go dead.
225 if (iff->outcnt() != 2) return;
226
227 // Make control-dependent data Nodes on the live path (path that will remain
228 // once the dominated IF is removed) become control-dependent on the
229 // dominating projection.
230 Node* dp = iff->as_If()->proj_out(pop == Op_IfTrue);
231
232 // Loop predicates may have depending checks which should not
233 // be skipped. For example, range check predicate has two checks
234 // for lower and upper bounds.
235 if (dp == NULL)
236 return;
237
238 ProjNode* dp_proj = dp->as_Proj();
239 ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp_proj->_con)->as_Proj();
240 if (exclude_loop_predicate &&
241 unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate))
242 return; // Let IGVN transformation change control dependence.
243
244 IdealLoopTree *old_loop = get_loop(dp);
245
246 for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) {
247 Node* cd = dp->fast_out(i); // Control-dependent node
248 if (cd->depends_only_on_test()) {
249 assert(cd->in(0) == dp, "");
250 _igvn.replace_input_of(cd, 0, prevdom);
251 set_early_ctrl(cd);
252 IdealLoopTree *new_loop = get_loop(get_ctrl(cd));
253 if (old_loop != new_loop) {
254 if (!old_loop->_child) old_loop->_body.yank(cd);
255 if (!new_loop->_child) new_loop->_body.push(cd);
256 }
257 --i;
258 --imax;
259 }
260 }
261 }
|