src/share/vm/opto/reg_split.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
6746892 Cdiff src/share/vm/opto/reg_split.cpp
src/share/vm/opto/reg_split.cpp
Print this page
*** 525,534 ****
--- 525,535 ----
}
// Initialize needs_phi and needs_split
bool needs_phi = false;
bool needs_split = false;
+ bool has_phi = false;
// Walk the predecessor blocks to check inputs for that live range
// Grab predecessor block header
n1 = b->pred(1);
// Grab the appropriate reaching def info for inpidx
pred = _cfg._bbs[n1->_idx];
*** 568,579 ****
n3 = n2;
u3 = u2;
}
} // End for all potential Phi inputs
- // If a phi is needed, check for it
- if( needs_phi ) {
// check block for appropriate phinode & update edges
for( insidx = 1; insidx <= b->end_idx(); insidx++ ) {
n1 = b->_nodes[insidx];
// bail if this is not a phi
phi = n1->is_Phi() ? n1->as_Phi() : NULL;
--- 569,578 ----
*** 585,599 ****
--- 584,602 ----
}
// must be looking at a phi
if( Find_id(n1) == lidxs.at(slidx) ) {
// found the necessary phi
needs_phi = false;
+ has_phi = true;
// initialize the Reaches entry for this LRG
Reachblock[slidx] = phi;
break;
} // end if found correct phi
} // end for all phi's
+
+ // If a phi is needed or exist, check for it
+ if( needs_phi || has_phi ) {
// add new phinode if one not already found
if( needs_phi ) {
// create a new phi node and insert it into the block
// type is taken from left over pointer to a predecessor
assert(n3,"No non-NULL reaching DEF for a Phi");
*** 661,671 ****
// locations.
// Memoize any DOWN reaching definitions for use as DEBUG info
for( insidx = 0; insidx < spill_cnt; insidx++ ) {
debug_defs[insidx] = (UPblock[insidx]) ? NULL : Reachblock[insidx];
! if( UPblock[insidx] ) // Memoize UP decision at block start
UP_entry[insidx]->set( b->_pre_order );
}
//----------Walk Instructions in the Block and Split----------
// For all non-phi instructions in the block
--- 664,674 ----
// locations.
// Memoize any DOWN reaching definitions for use as DEBUG info
for( insidx = 0; insidx < spill_cnt; insidx++ ) {
debug_defs[insidx] = (UPblock[insidx]) ? NULL : Reachblock[insidx];
! if( UPblock[insidx] ) // Memorize UP decision at block start
UP_entry[insidx]->set( b->_pre_order );
}
//----------Walk Instructions in the Block and Split----------
// For all non-phi instructions in the block
*** 693,703 ****
break;
u = n->in(i); // Else record it
}
}
assert( u, "at least 1 valid input expected" );
! if( i >= cnt ) { // Didn't find 2+ unique inputs?
n->replace_by(u); // Then replace with unique input
n->disconnect_inputs(NULL);
b->_nodes.remove(insidx);
insidx--;
b->_ihrp_index--;
--- 696,707 ----
break;
u = n->in(i); // Else record it
}
}
assert( u, "at least 1 valid input expected" );
! if( i >= cnt ) { // Found one unique input
! assert(Find_id(n) == Find_id(u), "should be the same lrg");
n->replace_by(u); // Then replace with unique input
n->disconnect_inputs(NULL);
b->_nodes.remove(insidx);
insidx--;
b->_ihrp_index--;
src/share/vm/opto/reg_split.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File