< prev index next >

src/hotspot/share/opto/loopnode.cpp

Print this page

4221 // Dump loops by loop tree
4222 void IdealLoopTree::dump() {
4223   dump_head();
4224   if (_child) _child->dump();
4225   if (_next)  _next ->dump();
4226 }
4227 
4228 #endif
4229 
4230 static void log_loop_tree_helper(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
4231   if (loop == root) {
4232     if (loop->_child != nullptr) {
4233       log->begin_head("loop_tree");
4234       log->end_head();
4235       log_loop_tree_helper(root, loop->_child, log);
4236       log->tail("loop_tree");
4237       assert(loop->_next == nullptr, "what?");
4238     }
4239   } else if (loop != nullptr) {
4240     Node* head = loop->_head;
4241     log->begin_head("loop");
4242     log->print(" idx='%d' ", head->_idx);
4243     if (loop->_irreducible) log->print("irreducible='1' ");
4244     if (head->is_Loop()) {
4245       if (head->as_Loop()->is_inner_loop())        log->print("inner_loop='1' ");
4246       if (head->as_Loop()->is_partial_peel_loop()) log->print("partial_peel_loop='1' ");
4247     } else if (head->is_CountedLoop()) {
4248       CountedLoopNode* cl = head->as_CountedLoop();
4249       if (cl->is_pre_loop())  log->print("pre_loop='%d' ",  cl->main_idx());
4250       if (cl->is_main_loop()) log->print("main_loop='%d' ", cl->_idx);
4251       if (cl->is_post_loop()) log->print("post_loop='%d' ", cl->main_idx());
4252     }
4253     log->end_head();
4254     log_loop_tree_helper(root, loop->_child, log);
4255     log->tail("loop");
4256     log_loop_tree_helper(root, loop->_next, log);
4257   }
4258 }
4259 
4260 void PhaseIdealLoop::log_loop_tree() {
4261   if (C->log() != nullptr) {
4262     log_loop_tree_helper(_ltree_root, _ltree_root, C->log());
4263   }
4264 }
4265 
4266 // Eliminate all Parse and Template Assertion Predicates that are not associated with a loop anymore. The eliminated
4267 // predicates will be removed during the next round of IGVN.
4268 void PhaseIdealLoop::eliminate_useless_predicates() {
4269   if (C->parse_predicate_count() == 0 && C->template_assertion_predicate_count() == 0) {
4270     return; // No predicates left.
4271   }

4221 // Dump loops by loop tree
4222 void IdealLoopTree::dump() {
4223   dump_head();
4224   if (_child) _child->dump();
4225   if (_next)  _next ->dump();
4226 }
4227 
4228 #endif
4229 
4230 static void log_loop_tree_helper(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
4231   if (loop == root) {
4232     if (loop->_child != nullptr) {
4233       log->begin_head("loop_tree");
4234       log->end_head();
4235       log_loop_tree_helper(root, loop->_child, log);
4236       log->tail("loop_tree");
4237       assert(loop->_next == nullptr, "what?");
4238     }
4239   } else if (loop != nullptr) {
4240     Node* head = loop->_head;
4241     log->begin_head("loop idx='%d'", head->_idx);
4242     if (loop->_irreducible) log->print(" irreducible='1'");

4243     if (head->is_Loop()) {
4244       if (head->as_Loop()->is_inner_loop())        log->print(" inner_loop='1'");
4245       if (head->as_Loop()->is_partial_peel_loop()) log->print(" partial_peel_loop='1'");
4246     } else if (head->is_CountedLoop()) {
4247       CountedLoopNode* cl = head->as_CountedLoop();
4248       if (cl->is_pre_loop())  log->print(" pre_loop='%d'",  cl->main_idx());
4249       if (cl->is_main_loop()) log->print(" main_loop='%d'", cl->_idx);
4250       if (cl->is_post_loop()) log->print(" post_loop='%d'", cl->main_idx());
4251     }
4252     log->end_head();
4253     log_loop_tree_helper(root, loop->_child, log);
4254     log->tail("loop");
4255     log_loop_tree_helper(root, loop->_next, log);
4256   }
4257 }
4258 
4259 void PhaseIdealLoop::log_loop_tree() {
4260   if (C->log() != nullptr) {
4261     log_loop_tree_helper(_ltree_root, _ltree_root, C->log());
4262   }
4263 }
4264 
4265 // Eliminate all Parse and Template Assertion Predicates that are not associated with a loop anymore. The eliminated
4266 // predicates will be removed during the next round of IGVN.
4267 void PhaseIdealLoop::eliminate_useless_predicates() {
4268   if (C->parse_predicate_count() == 0 && C->template_assertion_predicate_count() == 0) {
4269     return; // No predicates left.
4270   }
< prev index next >