1291 // Loop variant check (for example, range check in non-counted loop)
1292 // with uncommon trap.
1293 return false;
1294 }
1295 assert(new_predicate_proj != NULL, "sanity");
1296 // Success - attach condition (new_predicate_bol) to predicate if
1297 invar.map_ctrl(proj, new_predicate_proj); // so that invariance test can be appropriate
1298
1299 // Eliminate the old If in the loop body
1300 dominated_by( new_predicate_proj, iff, proj->_con != new_predicate_proj->_con );
1301
1302 C->set_major_progress();
1303 return true;
1304 }
1305
1306
1307 // After pre/main/post loops are created, we'll put a copy of some
1308 // range checks between the pre and main loop to validate the value
1309 // of the main loop induction variable. Make a copy of the predicates
1310 // here with an opaque node as a place holder for the value (will be
1311 // updated by PhaseIdealLoop::update_skeleton_predicate()).
1312 ProjNode* PhaseIdealLoop::insert_skeleton_predicate(IfNode* iff, IdealLoopTree *loop,
1313 ProjNode* proj, ProjNode *predicate_proj,
1314 ProjNode* upper_bound_proj,
1315 int scale, Node* offset,
1316 Node* init, Node* limit, jint stride,
1317 Node* rng, bool &overflow,
1318 Deoptimization::DeoptReason reason) {
1319 assert(proj->_con && predicate_proj->_con, "not a range check?");
1320 Node* opaque_init = new Opaque1Node(C, init);
1321 register_new_node(opaque_init, upper_bound_proj);
1322 BoolNode* bol = rc_predicate(loop, upper_bound_proj, scale, offset, opaque_init, limit, stride, rng, (stride > 0) != (scale > 0), overflow);
1323 Node* opaque_bol = new Opaque4Node(C, bol, _igvn.intcon(1)); // This will go away once loop opts are over
1324 register_new_node(opaque_bol, upper_bound_proj);
1325 ProjNode* new_proj = create_new_if_for_predicate(predicate_proj, NULL, reason, overflow ? Op_If : iff->Opcode());
1326 _igvn.replace_input_of(new_proj->in(0), 1, opaque_bol);
1327 assert(opaque_init->outcnt() > 0, "should be used");
1328 return new_proj;
1329 }
1330
1331 //------------------------------ loop_predication_impl--------------------------
|
1291 // Loop variant check (for example, range check in non-counted loop)
1292 // with uncommon trap.
1293 return false;
1294 }
1295 assert(new_predicate_proj != NULL, "sanity");
1296 // Success - attach condition (new_predicate_bol) to predicate if
1297 invar.map_ctrl(proj, new_predicate_proj); // so that invariance test can be appropriate
1298
1299 // Eliminate the old If in the loop body
1300 dominated_by( new_predicate_proj, iff, proj->_con != new_predicate_proj->_con );
1301
1302 C->set_major_progress();
1303 return true;
1304 }
1305
1306
1307 // After pre/main/post loops are created, we'll put a copy of some
1308 // range checks between the pre and main loop to validate the value
1309 // of the main loop induction variable. Make a copy of the predicates
1310 // here with an opaque node as a place holder for the value (will be
1311 // updated by PhaseIdealLoop::clone_skeleton_predicate()).
1312 ProjNode* PhaseIdealLoop::insert_skeleton_predicate(IfNode* iff, IdealLoopTree *loop,
1313 ProjNode* proj, ProjNode *predicate_proj,
1314 ProjNode* upper_bound_proj,
1315 int scale, Node* offset,
1316 Node* init, Node* limit, jint stride,
1317 Node* rng, bool &overflow,
1318 Deoptimization::DeoptReason reason) {
1319 assert(proj->_con && predicate_proj->_con, "not a range check?");
1320 Node* opaque_init = new Opaque1Node(C, init);
1321 register_new_node(opaque_init, upper_bound_proj);
1322 BoolNode* bol = rc_predicate(loop, upper_bound_proj, scale, offset, opaque_init, limit, stride, rng, (stride > 0) != (scale > 0), overflow);
1323 Node* opaque_bol = new Opaque4Node(C, bol, _igvn.intcon(1)); // This will go away once loop opts are over
1324 register_new_node(opaque_bol, upper_bound_proj);
1325 ProjNode* new_proj = create_new_if_for_predicate(predicate_proj, NULL, reason, overflow ? Op_If : iff->Opcode());
1326 _igvn.replace_input_of(new_proj->in(0), 1, opaque_bol);
1327 assert(opaque_init->outcnt() > 0, "should be used");
1328 return new_proj;
1329 }
1330
1331 //------------------------------ loop_predication_impl--------------------------
|