4261 // Dump loops by loop tree
4262 void IdealLoopTree::dump() {
4263 dump_head();
4264 if (_child) _child->dump();
4265 if (_next) _next ->dump();
4266 }
4267
4268 #endif
4269
4270 static void log_loop_tree_helper(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
4271 if (loop == root) {
4272 if (loop->_child != nullptr) {
4273 log->begin_head("loop_tree");
4274 log->end_head();
4275 log_loop_tree_helper(root, loop->_child, log);
4276 log->tail("loop_tree");
4277 assert(loop->_next == nullptr, "what?");
4278 }
4279 } else if (loop != nullptr) {
4280 Node* head = loop->_head;
4281 log->begin_head("loop");
4282 log->print(" idx='%d' ", head->_idx);
4283 if (loop->_irreducible) log->print("irreducible='1' ");
4284 if (head->is_Loop()) {
4285 if (head->as_Loop()->is_inner_loop()) log->print("inner_loop='1' ");
4286 if (head->as_Loop()->is_partial_peel_loop()) log->print("partial_peel_loop='1' ");
4287 } else if (head->is_CountedLoop()) {
4288 CountedLoopNode* cl = head->as_CountedLoop();
4289 if (cl->is_pre_loop()) log->print("pre_loop='%d' ", cl->main_idx());
4290 if (cl->is_main_loop()) log->print("main_loop='%d' ", cl->_idx);
4291 if (cl->is_post_loop()) log->print("post_loop='%d' ", cl->main_idx());
4292 }
4293 log->end_head();
4294 log_loop_tree_helper(root, loop->_child, log);
4295 log->tail("loop");
4296 log_loop_tree_helper(root, loop->_next, log);
4297 }
4298 }
4299
4300 void PhaseIdealLoop::log_loop_tree() {
4301 if (C->log() != nullptr) {
4302 log_loop_tree_helper(_ltree_root, _ltree_root, C->log());
4303 }
4304 }
4305
4306 // Eliminate all Parse and Template Assertion Predicates that are not associated with a loop anymore. The eliminated
4307 // predicates will be removed during the next round of IGVN.
4308 void PhaseIdealLoop::eliminate_useless_predicates() {
4309 if (C->parse_predicate_count() == 0 && C->template_assertion_predicate_count() == 0) {
4310 return; // No predicates left.
4311 }
|
4261 // Dump loops by loop tree
4262 void IdealLoopTree::dump() {
4263 dump_head();
4264 if (_child) _child->dump();
4265 if (_next) _next ->dump();
4266 }
4267
4268 #endif
4269
4270 static void log_loop_tree_helper(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
4271 if (loop == root) {
4272 if (loop->_child != nullptr) {
4273 log->begin_head("loop_tree");
4274 log->end_head();
4275 log_loop_tree_helper(root, loop->_child, log);
4276 log->tail("loop_tree");
4277 assert(loop->_next == nullptr, "what?");
4278 }
4279 } else if (loop != nullptr) {
4280 Node* head = loop->_head;
4281 log->begin_head("loop idx='%d'", head->_idx);
4282 if (loop->_irreducible) log->print(" irreducible='1'");
4283 if (head->is_Loop()) {
4284 if (head->as_Loop()->is_inner_loop()) log->print(" inner_loop='1'");
4285 if (head->as_Loop()->is_partial_peel_loop()) log->print(" partial_peel_loop='1'");
4286 } else if (head->is_CountedLoop()) {
4287 CountedLoopNode* cl = head->as_CountedLoop();
4288 if (cl->is_pre_loop()) log->print(" pre_loop='%d'", cl->main_idx());
4289 if (cl->is_main_loop()) log->print(" main_loop='%d'", cl->_idx);
4290 if (cl->is_post_loop()) log->print(" post_loop='%d'", cl->main_idx());
4291 }
4292 log->end_head();
4293 log_loop_tree_helper(root, loop->_child, log);
4294 log->tail("loop");
4295 log_loop_tree_helper(root, loop->_next, log);
4296 }
4297 }
4298
4299 void PhaseIdealLoop::log_loop_tree() {
4300 if (C->log() != nullptr) {
4301 log_loop_tree_helper(_ltree_root, _ltree_root, C->log());
4302 }
4303 }
4304
4305 // Eliminate all Parse and Template Assertion Predicates that are not associated with a loop anymore. The eliminated
4306 // predicates will be removed during the next round of IGVN.
4307 void PhaseIdealLoop::eliminate_useless_predicates() {
4308 if (C->parse_predicate_count() == 0 && C->template_assertion_predicate_count() == 0) {
4309 return; // No predicates left.
4310 }
|