8240223: Use consistent predicate order in and with PhaseIdealLoop::find_predicate

Reviewed-by: thartmann, neliasso, chagedorn
This commit is contained in:
Stefan Karlsson 2020-03-02 12:30:59 +01:00
parent d541a65da5
commit c779e24196
2 changed files with 9 additions and 9 deletions

View File

@ -156,7 +156,7 @@ void PhaseIdealLoop::do_unswitching(IdealLoopTree *loop, Node_List &old_new) {
if (predicate != NULL) {
entry = skip_loop_predicates(entry);
}
if (predicate != NULL && UseLoopPredicate) {
if (predicate != NULL && UseProfiledLoopPredicate) {
// We may have two predicates, find first.
Node* n = find_predicate(entry);
if (n != NULL) {
@ -164,7 +164,7 @@ void PhaseIdealLoop::do_unswitching(IdealLoopTree *loop, Node_List &old_new) {
entry = skip_loop_predicates(entry);
}
}
if (predicate != NULL && UseProfiledLoopPredicate) {
if (predicate != NULL && UseLoopPredicate) {
entry = find_predicate(entry);
if (entry != NULL) predicate = entry;
}

View File

@ -2657,22 +2657,22 @@ void PhaseIdealLoop::collect_potentially_useful_predicates(
LoopNode* lpn = loop->_head->as_Loop();
Node* entry = lpn->in(LoopNode::EntryControl);
Node* predicate_proj = find_predicate(entry); // loop_limit_check first
if (predicate_proj != NULL ) { // right pattern that can be used by loop predication
if (predicate_proj != NULL) { // right pattern that can be used by loop predication
assert(entry->in(0)->in(1)->in(1)->Opcode() == Op_Opaque1, "must be");
useful_predicates.push(entry->in(0)->in(1)->in(1)); // good one
entry = skip_loop_predicates(entry);
}
predicate_proj = find_predicate(entry); // Predicate
if (predicate_proj != NULL ) {
useful_predicates.push(entry->in(0)->in(1)->in(1)); // good one
entry = skip_loop_predicates(entry);
}
if (UseProfiledLoopPredicate) {
predicate_proj = find_predicate(entry); // Predicate
if (predicate_proj != NULL ) {
if (predicate_proj != NULL) {
useful_predicates.push(entry->in(0)->in(1)->in(1)); // good one
entry = skip_loop_predicates(entry);
}
}
predicate_proj = find_predicate(entry); // Predicate
if (predicate_proj != NULL) {
useful_predicates.push(entry->in(0)->in(1)->in(1)); // good one
}
}
if (loop->_next) { // sibling