comparison src/share/vm/opto/loopnode.cpp @ 39:76256d272075

6667612: (Escape Analysis) disable loop cloning if it has a scalar replaceable allocation Summary: Cloning an allocation will not allow scalar replacement since memory operations could not be associated with one allocation. Reviewed-by: rasbold
author kvn
date Thu, 06 Mar 2008 10:53:33 -0800
parents ff5961f4c095
children 9148c65abefc
comparison
equal deleted inserted replaced
38:b789bcaf2dd9 39:76256d272075
1559 // Because RCE opportunities can be masked by split_thru_phi, 1559 // Because RCE opportunities can be masked by split_thru_phi,
1560 // look for RCE candidates and inhibit split_thru_phi 1560 // look for RCE candidates and inhibit split_thru_phi
1561 // on just their loop-phi's for this pass of loop opts 1561 // on just their loop-phi's for this pass of loop opts
1562 if( SplitIfBlocks && do_split_ifs ) { 1562 if( SplitIfBlocks && do_split_ifs ) {
1563 if (lpt->policy_range_check(this)) { 1563 if (lpt->policy_range_check(this)) {
1564 lpt->_rce_candidate = true; 1564 lpt->_rce_candidate = 1; // = true
1565 } 1565 }
1566 } 1566 }
1567 } 1567 }
1568 } 1568 }
1569 1569
2143 // Weeny check for irreducible. This child was already visited (this 2143 // Weeny check for irreducible. This child was already visited (this
2144 // IS the post-work phase). Is this child's loop header post-visited 2144 // IS the post-work phase). Is this child's loop header post-visited
2145 // as well? If so, then I found another entry into the loop. 2145 // as well? If so, then I found another entry into the loop.
2146 while( is_postvisited(l->_head) ) { 2146 while( is_postvisited(l->_head) ) {
2147 // found irreducible 2147 // found irreducible
2148 l->_irreducible = true; 2148 l->_irreducible = 1; // = true
2149 l = l->_parent; 2149 l = l->_parent;
2150 _has_irreducible_loops = true; 2150 _has_irreducible_loops = true;
2151 // Check for bad CFG here to prevent crash, and bailout of compile 2151 // Check for bad CFG here to prevent crash, and bailout of compile
2152 if (l == NULL) { 2152 if (l == NULL) {
2153 C->record_method_not_compilable("unhandled CFG detected during loop optimization"); 2153 C->record_method_not_compilable("unhandled CFG detected during loop optimization");
2197 (n->in(0)->Opcode() == Op_IfFalse && 2197 (n->in(0)->Opcode() == Op_IfFalse &&
2198 (1.0 - iff->as_If()->_prob) >= 0.01) || 2198 (1.0 - iff->as_If()->_prob) >= 0.01) ||
2199 (iff->as_If()->_prob >= 0.01) ) 2199 (iff->as_If()->_prob >= 0.01) )
2200 innermost->_has_call = 1; 2200 innermost->_has_call = 1;
2201 } 2201 }
2202 } else if( n->is_Allocate() && n->as_Allocate()->_is_scalar_replaceable ) {
2203 // Disable loop optimizations if the loop has a scalar replaceable
2204 // allocation. This disabling may cause a potential performance lost
2205 // if the allocation is not eliminated for some reason.
2206 innermost->_allow_optimizations = false;
2207 innermost->_has_call = 1; // = true
2202 } 2208 }
2203 } 2209 }
2204 } 2210 }
2205 2211
2206 // Flag as post-visited now 2212 // Flag as post-visited now