comparison src/share/vm/opto/loopTransform.cpp @ 3398:789d04408ca3

7045693: java/util/EnumSet/EnumSetBash.java still failing intermittently Summary: New limit for unrolled loop should be set only for zero trip guard and loop iteration test. Reviewed-by: never
author kvn
date Sat, 21 May 2011 11:44:31 -0700
parents 38569792a45a
children 782e2bb60c41
comparison
equal deleted inserted replaced
3397:cfbca4d74a61 3398:789d04408ca3
1290 } 1290 }
1291 register_new_node(new_limit, ctrl); 1291 register_new_node(new_limit, ctrl);
1292 } 1292 }
1293 assert(new_limit != NULL, ""); 1293 assert(new_limit != NULL, "");
1294 // Replace in loop test. 1294 // Replace in loop test.
1295 _igvn.hash_delete(cmp); 1295 assert(loop_end->in(1)->in(1) == cmp, "sanity");
1296 cmp->set_req(2, new_limit); 1296 if (cmp->outcnt() == 1 && loop_end->in(1)->outcnt() == 1) {
1297 1297 // Don't need to create new test since only one user.
1298 _igvn.hash_delete(cmp);
1299 cmp->set_req(2, new_limit);
1300 } else {
1301 // Create new test since it is shared.
1302 Node* ctrl2 = loop_end->in(0);
1303 Node* cmp2 = cmp->clone();
1304 cmp2->set_req(2, new_limit);
1305 register_new_node(cmp2, ctrl2);
1306 Node* bol2 = loop_end->in(1)->clone();
1307 bol2->set_req(1, cmp2);
1308 register_new_node(bol2, ctrl2);
1309 _igvn.hash_delete(loop_end);
1310 loop_end->set_req(1, bol2);
1311 }
1298 // Step 3: Find the min-trip test guaranteed before a 'main' loop. 1312 // Step 3: Find the min-trip test guaranteed before a 'main' loop.
1299 // Make it a 1-trip test (means at least 2 trips). 1313 // Make it a 1-trip test (means at least 2 trips).
1300 1314
1301 // Guard test uses an 'opaque' node which is not shared. Hence I 1315 // Guard test uses an 'opaque' node which is not shared. Hence I
1302 // can edit it's inputs directly. Hammer in the new limit for the 1316 // can edit it's inputs directly. Hammer in the new limit for the