comparison src/share/vm/opto/reg_split.cpp @ 12967:4c9115774c8e

8026939: assert(Reachblock != NULL) failed: Reachblock must be non-NULL Summary: We can reach this state from phi input rematerialization, so pass in the Reaches of the predecessor Reviewed-by: roland, twisti
author adlertz
date Wed, 23 Oct 2013 10:44:12 +0200
parents 1856ea98184a
children de6a9e811145
comparison
equal deleted inserted replaced
12960:52575a17a36c 12967:4c9115774c8e
363 lidx = _lrg_map.find_id(in); 363 lidx = _lrg_map.find_id(in);
364 } 364 }
365 } 365 }
366 366
367 if (lidx < _lrg_map.max_lrg_id() && lrgs(lidx).reg() >= LRG::SPILL_REG) { 367 if (lidx < _lrg_map.max_lrg_id() && lrgs(lidx).reg() >= LRG::SPILL_REG) {
368 assert(Reachblock != NULL, "Reachblock must be non-NULL");
369 Node *rdef = Reachblock[lrg2reach[lidx]]; 368 Node *rdef = Reachblock[lrg2reach[lidx]];
370 if (rdef) { 369 if (rdef) {
371 spill->set_req(i, rdef); 370 spill->set_req(i, rdef);
372 } 371 }
373 } 372 }
474 // Free thread local resources used by this method on exit. 473 // Free thread local resources used by this method on exit.
475 ResourceMark rm(split_arena); 474 ResourceMark rm(split_arena);
476 475
477 uint bidx, pidx, slidx, insidx, inpidx, twoidx; 476 uint bidx, pidx, slidx, insidx, inpidx, twoidx;
478 uint non_phi = 1, spill_cnt = 0; 477 uint non_phi = 1, spill_cnt = 0;
479 Node **Reachblock;
480 Node *n1, *n2, *n3; 478 Node *n1, *n2, *n3;
481 Node_List *defs,*phis; 479 Node_List *defs,*phis;
482 bool *UPblock; 480 bool *UPblock;
483 bool u1, u2, u3; 481 bool u1, u2, u3;
484 Block *b, *pred; 482 Block *b, *pred;
557 return 0; 555 return 0;
558 } 556 }
559 557
560 b = _cfg.get_block(bidx); 558 b = _cfg.get_block(bidx);
561 // Reaches & UP arrays for this block 559 // Reaches & UP arrays for this block
562 Reachblock = Reaches[b->_pre_order]; 560 Node** Reachblock = Reaches[b->_pre_order];
563 UPblock = UP[b->_pre_order]; 561 UPblock = UP[b->_pre_order];
564 // Reset counter of start of non-Phi nodes in block 562 // Reset counter of start of non-Phi nodes in block
565 non_phi = 1; 563 non_phi = 1;
566 //----------Block Entry Handling---------- 564 //----------Block Entry Handling----------
567 // Check for need to insert a new phi 565 // Check for need to insert a new phi
1313 // Get predecessor block pre-order number 1311 // Get predecessor block pre-order number
1314 Block *pred = _cfg.get_block_for_node(b->pred(i)); 1312 Block *pred = _cfg.get_block_for_node(b->pred(i));
1315 pidx = pred->_pre_order; 1313 pidx = pred->_pre_order;
1316 // Grab reaching def 1314 // Grab reaching def
1317 Node *def = Reaches[pidx][slidx]; 1315 Node *def = Reaches[pidx][slidx];
1316 Node** Reachblock = Reaches[pidx];
1318 assert( def, "must have reaching def" ); 1317 assert( def, "must have reaching def" );
1319 // If input up/down sense and reg-pressure DISagree 1318 // If input up/down sense and reg-pressure DISagree
1320 if (def->rematerialize()) { 1319 if (def->rematerialize()) {
1321 // Place the rematerialized node above any MSCs created during 1320 // Place the rematerialized node above any MSCs created during
1322 // phi node splitting. end_idx points at the insertion point 1321 // phi node splitting. end_idx points at the insertion point
1325 while (insert >= 1 && 1324 while (insert >= 1 &&
1326 pred->get_node(insert - 1)->is_SpillCopy() && 1325 pred->get_node(insert - 1)->is_SpillCopy() &&
1327 _lrg_map.find(pred->get_node(insert - 1)) >= lrgs_before_phi_split) { 1326 _lrg_map.find(pred->get_node(insert - 1)) >= lrgs_before_phi_split) {
1328 insert--; 1327 insert--;
1329 } 1328 }
1330 // since the def cannot contain any live range input, we can pass in NULL as Reachlock parameter 1329 def = split_Rematerialize(def, pred, insert, maxlrg, splits, slidx, lrg2reach, Reachblock, false);
1331 def = split_Rematerialize(def, pred, insert, maxlrg, splits, slidx, lrg2reach, NULL, false);
1332 if (!def) { 1330 if (!def) {
1333 return 0; // Bail out 1331 return 0; // Bail out
1334 } 1332 }
1335 } 1333 }
1336 // Update the Phi's input edge array 1334 // Update the Phi's input edge array