comparison src/share/vm/opto/cfgnode.cpp @ 4113:8c57262447d3

7105605: Use EA info to optimize pointers compare Summary: optimize pointers compare using EA information. Reviewed-by: never, twisti
author kvn
date Mon, 14 Nov 2011 18:38:03 -0800
parents c96c3eb1efae
children 35acf8f0a2e4
comparison
equal deleted inserted replaced
4112:e8fdaf4a66cb 4113:8c57262447d3
458 458
459 if (can_reshape && cnt == 1) { 459 if (can_reshape && cnt == 1) {
460 // Is it dead loop? 460 // Is it dead loop?
461 // If it is LoopNopde it had 2 (+1 itself) inputs and 461 // If it is LoopNopde it had 2 (+1 itself) inputs and
462 // one of them was cut. The loop is dead if it was EntryContol. 462 // one of them was cut. The loop is dead if it was EntryContol.
463 assert(!this->is_Loop() || cnt_orig == 3, "Loop node should have 3 inputs"); 463 // Loop node may have only one input because entry path
464 if (this->is_Loop() && del_it == LoopNode::EntryControl || 464 // is removed in PhaseIdealLoop::Dominators().
465 assert(!this->is_Loop() || cnt_orig <= 3, "Loop node should have 3 or less inputs");
466 if (this->is_Loop() && (del_it == LoopNode::EntryControl ||
467 del_it == 0 && is_unreachable_region(phase)) ||
465 !this->is_Loop() && has_phis && is_unreachable_region(phase)) { 468 !this->is_Loop() && has_phis && is_unreachable_region(phase)) {
466 // Yes, the region will be removed during the next step below. 469 // Yes, the region will be removed during the next step below.
467 // Cut the backedge input and remove phis since no data paths left. 470 // Cut the backedge input and remove phis since no data paths left.
468 // We don't cut outputs to other nodes here since we need to put them 471 // We don't cut outputs to other nodes here since we need to put them
469 // on the worklist. 472 // on the worklist.
1583 return NULL; // Identity will return TOP 1586 return NULL; // Identity will return TOP
1584 } else if (uin != NULL) { 1587 } else if (uin != NULL) {
1585 // Only one not-NULL unique input path is left. 1588 // Only one not-NULL unique input path is left.
1586 // Determine if this input is backedge of a loop. 1589 // Determine if this input is backedge of a loop.
1587 // (Skip new phis which have no uses and dead regions). 1590 // (Skip new phis which have no uses and dead regions).
1588 if( outcnt() > 0 && r->in(0) != NULL ) { 1591 if (outcnt() > 0 && r->in(0) != NULL) {
1589 // First, take the short cut when we know it is a loop and 1592 // First, take the short cut when we know it is a loop and
1590 // the EntryControl data path is dead. 1593 // the EntryControl data path is dead.
1591 assert(!r->is_Loop() || r->req() == 3, "Loop node should have 3 inputs"); 1594 // Loop node may have only one input because entry path
1595 // is removed in PhaseIdealLoop::Dominators().
1596 assert(!r->is_Loop() || r->req() <= 3, "Loop node should have 3 or less inputs");
1597 bool is_loop = (r->is_Loop() && r->req() == 3);
1592 // Then, check if there is a data loop when phi references itself directly 1598 // Then, check if there is a data loop when phi references itself directly
1593 // or through other data nodes. 1599 // or through other data nodes.
1594 if( r->is_Loop() && !phase->eqv_uncast(uin, in(LoopNode::EntryControl)) || 1600 if (is_loop && !phase->eqv_uncast(uin, in(LoopNode::EntryControl)) ||
1595 !r->is_Loop() && is_unsafe_data_reference(uin) ) { 1601 !is_loop && is_unsafe_data_reference(uin)) {
1596 // Break this data loop to avoid creation of a dead loop. 1602 // Break this data loop to avoid creation of a dead loop.
1597 if (can_reshape) { 1603 if (can_reshape) {
1598 return top; 1604 return top;
1599 } else { 1605 } else {
1600 // We can't return top if we are in Parse phase - cut inputs only 1606 // We can't return top if we are in Parse phase - cut inputs only