8268884: C2: Compile::remove_speculative_types must iterate top-down

Reviewed-by: roland, kvn
This commit is contained in:
Nils Eliasson 2021-06-29 18:38:25 +00:00
parent 25f9f19af9
commit b8a16e931b

View File

@ -4581,10 +4581,12 @@ void Compile::remove_speculative_types(PhaseIterGVN &igvn) {
modified++;
}
}
uint max = n->len();
for( uint i = 0; i < max; ++i ) {
Node *m = n->in(i);
if (not_a_node(m)) continue;
// Iterate over outs - endless loops is unreachable from below
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
Node *m = n->fast_out(i);
if (not_a_node(m)) {
continue;
}
worklist.push(m);
}
}
@ -4605,10 +4607,12 @@ void Compile::remove_speculative_types(PhaseIterGVN &igvn) {
t = n->as_Type()->type();
assert(t == t->remove_speculative(), "no more speculative types");
}
uint max = n->len();
for( uint i = 0; i < max; ++i ) {
Node *m = n->in(i);
if (not_a_node(m)) continue;
// Iterate over outs - endless loops is unreachable from below
for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) {
Node *m = n->fast_out(i);
if (not_a_node(m)) {
continue;
}
worklist.push(m);
}
}