8308084: C2 fix idom bug in PhaseIdealLoop::create_new_if_for_predicate

Reviewed-by: chagedorn, thartmann, kvn
This commit is contained in:
Emanuel Peter 2023-05-22 06:26:55 +00:00
parent b6a9f5c304
commit 41beb448d2

View File

@ -333,13 +333,6 @@ IfProjNode* PhaseIdealLoop::create_new_if_for_predicate(IfProjNode* cont_proj, N
_igvn.add_input_to(rgn, if_uct);
// When called from beautify_loops() idom is not constructed yet.
if (_idom != nullptr) {
Node* ridom = idom(rgn);
Node* nrdom = dom_lca_internal(ridom, new_iff);
set_idom(rgn, nrdom, dom_depth(rgn));
}
// If rgn has phis add new edges which has the same
// value as on original uncommon_proj pass.
assert(rgn->in(rgn->req() -1) == if_uct, "new edge should be last");
@ -377,6 +370,14 @@ IfProjNode* PhaseIdealLoop::create_new_if_for_predicate(IfProjNode* cont_proj, N
set_idom(iff, if_cont, dom_depth(iff));
}
}
// When called from beautify_loops() idom is not constructed yet.
if (_idom != nullptr) {
Node* ridom = idom(rgn);
Node* nrdom = dom_lca_internal(ridom, new_iff);
set_idom(rgn, nrdom, dom_depth(rgn));
}
return if_cont->as_IfProj();
}