Skip to content

Commit 41beb44

Browse files
committed
8308084: C2 fix idom bug in PhaseIdealLoop::create_new_if_for_predicate
Reviewed-by: chagedorn, thartmann, kvn
1 parent b6a9f5c commit 41beb44

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/hotspot/share/opto/loopPredicate.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,6 @@ IfProjNode* PhaseIdealLoop::create_new_if_for_predicate(IfProjNode* cont_proj, N
333333

334334
_igvn.add_input_to(rgn, if_uct);
335335

336-
// When called from beautify_loops() idom is not constructed yet.
337-
if (_idom != nullptr) {
338-
Node* ridom = idom(rgn);
339-
Node* nrdom = dom_lca_internal(ridom, new_iff);
340-
set_idom(rgn, nrdom, dom_depth(rgn));
341-
}
342-
343336
// If rgn has phis add new edges which has the same
344337
// value as on original uncommon_proj pass.
345338
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
377370
set_idom(iff, if_cont, dom_depth(iff));
378371
}
379372
}
373+
374+
// When called from beautify_loops() idom is not constructed yet.
375+
if (_idom != nullptr) {
376+
Node* ridom = idom(rgn);
377+
Node* nrdom = dom_lca_internal(ridom, new_iff);
378+
set_idom(rgn, nrdom, dom_depth(rgn));
379+
}
380+
380381
return if_cont->as_IfProj();
381382
}
382383

0 commit comments

Comments
 (0)