8256016: Dacapo24H.java failed with "assert(false) failed: unscheduable graph"

Reviewed-by: kvn, vlivanov
This commit is contained in:
Christian Hagedorn 2020-11-25 14:00:40 +00:00
parent 26e6cb3eb9
commit 7aed9b65d0

View File

@ -1605,7 +1605,23 @@ Node* IfNode::simple_subsuming(PhaseIterGVN* igvn) {
}
#endif
// Replace condition with constant True(1)/False(0).
set_req(1, igvn->intcon(br == tb ? 1 : 0));
bool is_always_true = br == tb;
set_req(1, igvn->intcon(is_always_true ? 1 : 0));
// Update any data dependencies to the directly dominating test. This subsumed test is not immediately removed by igvn
// and therefore subsequent optimizations might miss these data dependencies otherwise. There might be a dead loop
// ('always_taken_proj' == 'pre') that is cleaned up later. Skip this case to make the iterator work properly.
Node* always_taken_proj = proj_out(is_always_true);
if (always_taken_proj != pre) {
for (DUIterator_Fast imax, i = always_taken_proj->fast_outs(imax); i < imax; i++) {
Node* u = always_taken_proj->fast_out(i);
if (!u->is_CFG()) {
igvn->replace_input_of(u, 0, pre);
--i;
--imax;
}
}
}
if (bol->outcnt() == 0) {
igvn->remove_dead_node(bol); // Kill the BoolNode.