src/share/vm/opto/reg_split.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/opto/reg_split.cpp Wed Aug 7 02:26:16 2013
--- new/src/share/vm/opto/reg_split.cpp Wed Aug 7 02:26:16 2013
*** 130,140 ****
--- 130,140 ----
b = b->_succs[sidx]; // Switch to successor block
i = 1; // Right at start of block
}
b->_nodes.insert(i,spill); // Insert node in block
! _cfg._bbs.map(spill->_idx,b); // Update node->block mapping to reflect
! _cfg.map_node_to_block(spill, b); // Update node->block mapping to reflect
// Adjust the point where we go hi-pressure
if( i <= b->_ihrp_index ) b->_ihrp_index++;
if( i <= b->_fhrp_index ) b->_fhrp_index++;
// Assign a new Live Range Number to the SpillCopy and grow
*** 217,227 ****
--- 217,227 ----
if( def_down ) {
// DEF is DOWN, so connect USE directly to the DEF
use->set_req(useidx, def);
} else {
// Block and index where the use occurs.
! Block *b = _cfg._bbs[use->_idx];
! Block *b = _cfg.get_block_for_node(use);
// Put the clone just prior to use
int bindex = b->find_node(use);
// DEF is UP, so must copy it DOWN and hook in USE
// Insert SpillCopy before the USE, which uses DEF as its input,
// and defs a new live range, which is used by this node.
*** 268,278 ****
--- 268,278 ----
// Block and index where the use occurs.
int bindex;
// Phi input spill-copys belong at the end of the prior block
if( use->is_Phi() ) {
! b = _cfg._bbs[b->pred(useidx)->_idx];
! b = _cfg.get_block_for_node(b->pred(useidx));
bindex = b->end_idx();
} else {
// Put the clone just prior to use
bindex = b->find_node(use);
}
*** 333,343 ****
--- 333,343 ----
}
if (lrgs(lidx).is_singledef()) {
continue;
}
! Block *b_def = _cfg._bbs[def->_idx];
! Block *b_def = _cfg.get_block_for_node(def);
int idx_def = b_def->find_node(def);
Node *in_spill = get_spillcopy_wide( in, def, i );
if( !in_spill ) return 0; // Bailed out
insert_proj(b_def,idx_def,in_spill,maxlrg++);
if( b_def == b )
*** 587,597 ****
--- 587,597 ----
// reset the Reaches & UP entries
Reachblock[slidx] = lrgs(lidx)._def;
UPblock[slidx] = true;
// Record following instruction in case 'n' rematerializes and
// kills flags
! Block *pred1 = _cfg._bbs[b->pred(1)->_idx];
! Block *pred1 = _cfg.get_block_for_node(b->pred(1));
continue;
}
// Initialize needs_phi and needs_split
bool needs_phi = false;
*** 599,609 ****
--- 599,609 ----
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];
! pred = _cfg.get_block_for_node(n1);
pidx = pred->_pre_order;
Node **Ltmp = Reaches[pidx];
bool *Utmp = UP[pidx];
n1 = Ltmp[slidx];
u1 = Utmp[slidx];
*** 614,624 ****
--- 614,624 ----
// Compare inputs to see if a Phi is needed
for( inpidx = 2; inpidx < b->num_preds(); inpidx++ ) {
// Grab predecessor block headers
n2 = b->pred(inpidx);
// Grab the appropriate reaching def info for inpidx
! pred = _cfg._bbs[n2->_idx];
! pred = _cfg.get_block_for_node(n2);
pidx = pred->_pre_order;
Ltmp = Reaches[pidx];
Utmp = UP[pidx];
n2 = Ltmp[slidx];
u2 = Utmp[slidx];
*** 699,709 ****
--- 699,709 ----
// Do not need a phi, so grab the reaching DEF
else {
// Grab predecessor block header
n1 = b->pred(1);
// Grab the appropriate reaching def info for k
! pred = _cfg._bbs[n1->_idx];
! pred = _cfg.get_block_for_node(n1);
pidx = pred->_pre_order;
Node **Ltmp = Reaches[pidx];
bool *Utmp = UP[pidx];
// reset the Reaches & UP entries
Reachblock[slidx] = Ltmp[slidx];
*** 917,927 ****
--- 917,927 ----
def = clone_node(def, b, C);
if (def == NULL || C->check_node_count(NodeLimitFudgeFactor, out_of_nodes)) {
return 0;
}
_lrg_map.extend(def->_idx, 0);
! _cfg._bbs.map(def->_idx,b);
! _cfg.map_node_to_block(def, b);
n->set_req(inpidx, def);
continue;
}
// Rematerializable? Then clone def at use site instead
*** 1289,1299 ****
--- 1289,1299 ----
// Walk the phis list to patch inputs, split phis, and name phis
uint lrgs_before_phi_split = maxlrg;
for( insidx = 0; insidx < phis->size(); insidx++ ) {
Node *phi = phis->at(insidx);
assert(phi->is_Phi(),"This list must only contain Phi Nodes");
! Block *b = _cfg._bbs[phi->_idx];
! Block *b = _cfg.get_block_for_node(phi);
// Grab the live range number
uint lidx = _lrg_map.find_id(phi);
uint slidx = lrg2reach[lidx];
// Update node to lidx map
new_lrg(phi, maxlrg++);
*** 1313,1323 ****
--- 1313,1323 ----
// Walk the predecessor blocks and assign the reaching def to the Phi.
// Split Phi nodes by placing USE side splits wherever the reaching
// DEF has the wrong UP/DOWN value.
for( uint i = 1; i < b->num_preds(); i++ ) {
// Get predecessor block pre-order number
! Block *pred = _cfg._bbs[b->pred(i)->_idx];
! Block *pred = _cfg.get_block_for_node(b->pred(i));
pidx = pred->_pre_order;
// Grab reaching def
Node *def = Reaches[pidx][slidx];
assert( def, "must have reaching def" );
// If input up/down sense and reg-pressure DISagree
src/share/vm/opto/reg_split.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File