src/share/vm/opto/phaseX.cpp

changeset 7394
5b8e0f84f00f
parent 6681
1555c0843770
child 7395
4c228230f1d6
equal deleted inserted replaced
7392:97f4214e9a70 7394:5b8e0f84f00f
1338 if (p != NULL) { 1338 if (p != NULL) {
1339 add_users_to_worklist0(p); 1339 add_users_to_worklist0(p);
1340 } 1340 }
1341 } 1341 }
1342 1342
1343 if( use->is_Cmp() ) { // Enable CMP/BOOL optimization 1343 uint use_op = use->Opcode();
1344 if(use->is_Cmp()) { // Enable CMP/BOOL optimization
1344 add_users_to_worklist(use); // Put Bool on worklist 1345 add_users_to_worklist(use); // Put Bool on worklist
1345 // Look for the 'is_x2logic' pattern: "x ? : 0 : 1" and put the
1346 // phi merging either 0 or 1 onto the worklist
1347 if (use->outcnt() > 0) { 1346 if (use->outcnt() > 0) {
1348 Node* bol = use->raw_out(0); 1347 Node* bol = use->raw_out(0);
1349 if (bol->outcnt() > 0) { 1348 if (bol->outcnt() > 0) {
1350 Node* iff = bol->raw_out(0); 1349 Node* iff = bol->raw_out(0);
1351 if (iff->outcnt() == 2) { 1350 if (use_op == Op_CmpI &&
1351 iff->is_CountedLoopEnd()) {
1352 CountedLoopEndNode* cle = iff->as_CountedLoopEnd();
1353 if (cle->limit() == n && cle->phi() != NULL) {
1354 // If an opaque node feeds into the limit condition of a
1355 // CountedLoop, we need to process the Phi node for the
1356 // induction variable when the opaque node is removed:
1357 // the range of values taken by the Phi is now known and
1358 // so its type is also known.
1359 _worklist.push(cle->phi());
1360 }
1361 } else if (iff->outcnt() == 2) {
1362 // Look for the 'is_x2logic' pattern: "x ? : 0 : 1" and put the
1363 // phi merging either 0 or 1 onto the worklist
1352 Node* ifproj0 = iff->raw_out(0); 1364 Node* ifproj0 = iff->raw_out(0);
1353 Node* ifproj1 = iff->raw_out(1); 1365 Node* ifproj1 = iff->raw_out(1);
1354 if (ifproj0->outcnt() > 0 && ifproj1->outcnt() > 0) { 1366 if (ifproj0->outcnt() > 0 && ifproj1->outcnt() > 0) {
1355 Node* region0 = ifproj0->raw_out(0); 1367 Node* region0 = ifproj0->raw_out(0);
1356 Node* region1 = ifproj1->raw_out(0); 1368 Node* region1 = ifproj1->raw_out(0);
1358 add_users_to_worklist0(region0); 1370 add_users_to_worklist0(region0);
1359 } 1371 }
1360 } 1372 }
1361 } 1373 }
1362 } 1374 }
1363 } 1375 if (use_op == Op_CmpI) {
1364 1376 Node* in1 = use->in(1);
1365 uint use_op = use->Opcode(); 1377 for (uint i = 0; i < in1->outcnt(); i++) {
1378 if (in1->raw_out(i)->Opcode() == Op_CastII) {
1379 Node* castii = in1->raw_out(i);
1380 if (castii->in(0) != NULL && castii->in(0)->in(0) != NULL && castii->in(0)->in(0)->is_If()) {
1381 Node* ifnode = castii->in(0)->in(0);
1382 if (ifnode->in(1) != NULL && ifnode->in(1)->in(1) == use) {
1383 // Reprocess a CastII node that may depend on an
1384 // opaque node value when the opaque node is
1385 // removed. In case it carries a dependency we can do
1386 // a better job of computing its type.
1387 _worklist.push(castii);
1388 }
1389 }
1390 }
1391 }
1392 }
1393 }
1394
1366 // If changed Cast input, check Phi users for simple cycles 1395 // If changed Cast input, check Phi users for simple cycles
1367 if( use->is_ConstraintCast() || use->is_CheckCastPP() ) { 1396 if( use->is_ConstraintCast() || use->is_CheckCastPP() ) {
1368 for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) { 1397 for (DUIterator_Fast i2max, i2 = use->fast_outs(i2max); i2 < i2max; i2++) {
1369 Node* u = use->fast_out(i2); 1398 Node* u = use->fast_out(i2);
1370 if (u->is_Phi()) 1399 if (u->is_Phi())

mercurial