8027754: Enable loop optimizations for loops with MathExact inside

Reviewed-by: kvn, iveresov
This commit is contained in:
Rickard Bäckman 2014-01-23 12:08:28 +01:00
parent e2fecea88e
commit 0b85ee832e
73 changed files with 675 additions and 1157 deletions

View file

@ -3028,42 +3028,6 @@ void Compile::final_graph_reshaping_impl( Node *n, Final_Reshape_Counts &frc) {
n->set_req(MemBarNode::Precedent, top());
}
break;
// Must set a control edge on all nodes that produce a FlagsProj
// so they can't escape the block that consumes the flags.
// Must also set the non throwing branch as the control
// for all nodes that depends on the result. Unless the node
// already have a control that isn't the control of the
// flag producer
case Op_FlagsProj:
{
MathExactNode* math = (MathExactNode*) n->in(0);
Node* ctrl = math->control_node();
Node* non_throwing = math->non_throwing_branch();
math->set_req(0, ctrl);
Node* result = math->result_node();
if (result != NULL) {
for (DUIterator_Fast jmax, j = result->fast_outs(jmax); j < jmax; j++) {
Node* out = result->fast_out(j);
// Phi nodes shouldn't be moved. They would only match below if they
// had the same control as the MathExactNode. The only time that
// would happen is if the Phi is also an input to the MathExact
//
// Cmp nodes shouldn't have control set at all.
if (out->is_Phi() ||
out->is_Cmp()) {
continue;
}
if (out->in(0) == NULL) {
out->set_req(0, non_throwing);
} else if (out->in(0) == ctrl) {
out->set_req(0, non_throwing);
}
}
}
}
break;
default:
assert( !n->is_Call(), "" );
assert( !n->is_Mem(), "" );