313 } else { // End of if Phi
314
315 // Now check for 2-address instructions
316 uint idx;
317 if( n->is_Mach() && (idx=n->as_Mach()->two_adr()) ) {
318 // Get the chosen name for the Node
319 uint name = _phc._lrg_map.find(n);
320 assert (name, "no 2-address specials");
321 // Check for name mis-match on the 2-address input
322 Node *m = n->in(idx);
323 if (_phc._lrg_map.find(m) != name) {
324 Node *copy;
325 assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach");
326 // At this point it is unsafe to extend live ranges (6550579).
327 // Rematerialize only constants as we do for Phi above.
328 if(m->is_Mach() && m->as_Mach()->is_Con() &&
329 m->as_Mach()->rematerialize()) {
330 copy = m->clone();
331 // Insert the copy in the basic block, just before us
332 b->_nodes.insert(l++, copy);
333 if(_phc.clone_projs(b, l, m, copy, _phc._lrg_map)) {
334 l++;
335 }
336 } else {
337 const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()];
338 copy = new (C) MachSpillCopyNode(m, *rm, *rm);
339 // Insert the copy in the basic block, just before us
340 b->_nodes.insert(l++, copy);
341 }
342 // Insert the copy in the use-def chain
343 n->set_req(idx, copy);
344 // Extend ("register allocate") the names array for the copy.
345 _phc._lrg_map.extend(copy->_idx, name);
346 _phc._cfg._bbs.map( copy->_idx, b );
347 }
348
349 } // End of is two-adr
350
351 // Insert a copy at a debug use for a lrg which has high frequency
352 if (b->_freq < OPTO_DEBUG_SPLIT_FREQ || b->is_uncommon(_phc._cfg._bbs)) {
353 // Walk the debug inputs to the node and check for lrg freq
354 JVMState* jvms = n->jvms();
355 uint debug_start = jvms ? jvms->debug_start() : 999999;
|
313 } else { // End of if Phi
314
315 // Now check for 2-address instructions
316 uint idx;
317 if( n->is_Mach() && (idx=n->as_Mach()->two_adr()) ) {
318 // Get the chosen name for the Node
319 uint name = _phc._lrg_map.find(n);
320 assert (name, "no 2-address specials");
321 // Check for name mis-match on the 2-address input
322 Node *m = n->in(idx);
323 if (_phc._lrg_map.find(m) != name) {
324 Node *copy;
325 assert(!m->is_Con() || m->is_Mach(), "all Con must be Mach");
326 // At this point it is unsafe to extend live ranges (6550579).
327 // Rematerialize only constants as we do for Phi above.
328 if(m->is_Mach() && m->as_Mach()->is_Con() &&
329 m->as_Mach()->rematerialize()) {
330 copy = m->clone();
331 // Insert the copy in the basic block, just before us
332 b->_nodes.insert(l++, copy);
333 l += _phc.clone_projs(b, l, m, copy, _phc._lrg_map);
334 } else {
335 const RegMask *rm = C->matcher()->idealreg2spillmask[m->ideal_reg()];
336 copy = new (C) MachSpillCopyNode(m, *rm, *rm);
337 // Insert the copy in the basic block, just before us
338 b->_nodes.insert(l++, copy);
339 }
340 // Insert the copy in the use-def chain
341 n->set_req(idx, copy);
342 // Extend ("register allocate") the names array for the copy.
343 _phc._lrg_map.extend(copy->_idx, name);
344 _phc._cfg._bbs.map( copy->_idx, b );
345 }
346
347 } // End of is two-adr
348
349 // Insert a copy at a debug use for a lrg which has high frequency
350 if (b->_freq < OPTO_DEBUG_SPLIT_FREQ || b->is_uncommon(_phc._cfg._bbs)) {
351 // Walk the debug inputs to the node and check for lrg freq
352 JVMState* jvms = n->jvms();
353 uint debug_start = jvms ? jvms->debug_start() : 999999;
|