< prev index next >

src/hotspot/share/opto/loopnode.cpp

Print this page

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

4327 // Dump loops by loop tree
4328 void IdealLoopTree::dump() {
4329   dump_head();
4330   if (_child) _child->dump();
4331   if (_next)  _next ->dump();
4332 }
4333 
4334 #endif
4335 
4336 static void log_loop_tree_helper(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
4337   if (loop == root) {
4338     if (loop->_child != nullptr) {
4339       log->begin_head("loop_tree");
4340       log->end_head();
4341       log_loop_tree_helper(root, loop->_child, log);
4342       log->tail("loop_tree");
4343       assert(loop->_next == nullptr, "what?");
4344     }
4345   } else if (loop != nullptr) {
4346     Node* head = loop->_head;
4347     log->begin_head("loop idx='%d'", head->_idx);
4348     if (loop->_irreducible) log->print(" irreducible='1'");

4349     if (head->is_Loop()) {
4350       if (head->as_Loop()->is_inner_loop())        log->print(" inner_loop='1'");
4351       if (head->as_Loop()->is_partial_peel_loop()) log->print(" partial_peel_loop='1'");
4352     } else if (head->is_CountedLoop()) {
4353       CountedLoopNode* cl = head->as_CountedLoop();
4354       if (cl->is_pre_loop())  log->print(" pre_loop='%d'",  cl->main_idx());
4355       if (cl->is_main_loop()) log->print(" main_loop='%d'", cl->_idx);
4356       if (cl->is_post_loop()) log->print(" post_loop='%d'", cl->main_idx());
4357     }
4358     log->end_head();
4359     log_loop_tree_helper(root, loop->_child, log);
4360     log->tail("loop");
4361     log_loop_tree_helper(root, loop->_next, log);
4362   }
4363 }
4364 
4365 void PhaseIdealLoop::log_loop_tree() {
4366   if (C->log() != nullptr) {
4367     log_loop_tree_helper(_ltree_root, _ltree_root, C->log());
4368   }
4369 }
4370 
4371 // Eliminate all Parse and Template Assertion Predicates that are not associated with a loop anymore. The eliminated
4372 // predicates will be removed during the next round of IGVN.
4373 void PhaseIdealLoop::eliminate_useless_predicates() {
4374   if (C->parse_predicate_count() == 0 && C->template_assertion_predicate_count() == 0) {
4375     return; // No predicates left.
4376   }
< prev index next >