4337 // Dump loops by loop tree
4338 void IdealLoopTree::dump() {
4339 dump_head();
4340 if (_child) _child->dump();
4341 if (_next) _next ->dump();
4342 }
4343
4344 #endif
4345
4346 static void log_loop_tree_helper(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
4347 if (loop == root) {
4348 if (loop->_child != nullptr) {
4349 log->begin_head("loop_tree");
4350 log->end_head();
4351 log_loop_tree_helper(root, loop->_child, log);
4352 log->tail("loop_tree");
4353 assert(loop->_next == nullptr, "what?");
4354 }
4355 } else if (loop != nullptr) {
4356 Node* head = loop->_head;
4357 log->begin_head("loop");
4358 log->print(" idx='%d' ", head->_idx);
4359 if (loop->_irreducible) log->print("irreducible='1' ");
4360 if (head->is_Loop()) {
4361 if (head->as_Loop()->is_inner_loop()) log->print("inner_loop='1' ");
4362 if (head->as_Loop()->is_partial_peel_loop()) log->print("partial_peel_loop='1' ");
4363 } else if (head->is_CountedLoop()) {
4364 CountedLoopNode* cl = head->as_CountedLoop();
4365 if (cl->is_pre_loop()) log->print("pre_loop='%d' ", cl->main_idx());
4366 if (cl->is_main_loop()) log->print("main_loop='%d' ", cl->_idx);
4367 if (cl->is_post_loop()) log->print("post_loop='%d' ", cl->main_idx());
4368 }
4369 log->end_head();
4370 log_loop_tree_helper(root, loop->_child, log);
4371 log->tail("loop");
4372 log_loop_tree_helper(root, loop->_next, log);
4373 }
4374 }
4375
4376 void PhaseIdealLoop::log_loop_tree() {
4377 if (C->log() != nullptr) {
4378 log_loop_tree_helper(_ltree_root, _ltree_root, C->log());
4379 }
4380 }
4381
4382 // Eliminate all Parse and Template Assertion Predicates that are not associated with a loop anymore. The eliminated
4383 // predicates will be removed during the next round of IGVN.
4384 void PhaseIdealLoop::eliminate_useless_predicates() {
4385 if (C->parse_predicate_count() == 0 && C->template_assertion_predicate_count() == 0) {
4386 return; // No predicates left.
4387 }
|
4337 // Dump loops by loop tree
4338 void IdealLoopTree::dump() {
4339 dump_head();
4340 if (_child) _child->dump();
4341 if (_next) _next ->dump();
4342 }
4343
4344 #endif
4345
4346 static void log_loop_tree_helper(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
4347 if (loop == root) {
4348 if (loop->_child != nullptr) {
4349 log->begin_head("loop_tree");
4350 log->end_head();
4351 log_loop_tree_helper(root, loop->_child, log);
4352 log->tail("loop_tree");
4353 assert(loop->_next == nullptr, "what?");
4354 }
4355 } else if (loop != nullptr) {
4356 Node* head = loop->_head;
4357 log->begin_head("loop idx='%d'", head->_idx);
4358 if (loop->_irreducible) log->print(" irreducible='1'");
4359 if (head->is_Loop()) {
4360 if (head->as_Loop()->is_inner_loop()) log->print(" inner_loop='1'");
4361 if (head->as_Loop()->is_partial_peel_loop()) log->print(" partial_peel_loop='1'");
4362 } else if (head->is_CountedLoop()) {
4363 CountedLoopNode* cl = head->as_CountedLoop();
4364 if (cl->is_pre_loop()) log->print(" pre_loop='%d'", cl->main_idx());
4365 if (cl->is_main_loop()) log->print(" main_loop='%d'", cl->_idx);
4366 if (cl->is_post_loop()) log->print(" post_loop='%d'", cl->main_idx());
4367 }
4368 log->end_head();
4369 log_loop_tree_helper(root, loop->_child, log);
4370 log->tail("loop");
4371 log_loop_tree_helper(root, loop->_next, log);
4372 }
4373 }
4374
4375 void PhaseIdealLoop::log_loop_tree() {
4376 if (C->log() != nullptr) {
4377 log_loop_tree_helper(_ltree_root, _ltree_root, C->log());
4378 }
4379 }
4380
4381 // Eliminate all Parse and Template Assertion Predicates that are not associated with a loop anymore. The eliminated
4382 // predicates will be removed during the next round of IGVN.
4383 void PhaseIdealLoop::eliminate_useless_predicates() {
4384 if (C->parse_predicate_count() == 0 && C->template_assertion_predicate_count() == 0) {
4385 return; // No predicates left.
4386 }
|