< prev index next >

src/hotspot/share/opto/loopnode.cpp

Print this page




2330     // Not a counted loop. Keep one safepoint.
2331     bool keep_one_sfpt = true;
2332     remove_safepoints(phase, keep_one_sfpt);
2333   }
2334 
2335   // Recursively
2336   assert(loop->_child != this || (loop->_head->as_Loop()->is_OuterStripMinedLoop() && _head->as_CountedLoop()->is_strip_mined()), "what kind of loop was added?");
2337   assert(loop->_child != this || (loop->_child->_child == NULL && loop->_child->_next == NULL), "would miss some loops");
2338   if (loop->_child && loop->_child != this) loop->_child->counted_loop(phase);
2339   if (loop->_next)  loop->_next ->counted_loop(phase);
2340 }
2341 
2342 #ifndef PRODUCT
2343 //------------------------------dump_head--------------------------------------
2344 // Dump 1 liner for loop header info
2345 void IdealLoopTree::dump_head( ) const {
2346   for (uint i=0; i<_nest; i++)
2347     tty->print("  ");
2348   tty->print("Loop: N%d/N%d ",_head->_idx,_tail->_idx);
2349   if (_irreducible) tty->print(" IRREDUCIBLE");
2350   Node* entry = _head->as_Loop()->skip_strip_mined(-1)->in(LoopNode::EntryControl);
2351   Node* predicate = PhaseIdealLoop::find_predicate_insertion_point(entry, Deoptimization::Reason_loop_limit_check);
2352   if (predicate != NULL ) {
2353     tty->print(" limit_check");
2354     entry = entry->in(0)->in(0);
2355   }
2356   if (UseLoopPredicate) {
2357     entry = PhaseIdealLoop::find_predicate_insertion_point(entry, Deoptimization::Reason_predicate);
2358     if (entry != NULL) {
2359       tty->print(" predicated");
2360     }
2361   }
2362   if (_head->is_CountedLoop()) {
2363     CountedLoopNode *cl = _head->as_CountedLoop();
2364     tty->print(" counted");
2365 
2366     Node* init_n = cl->init_trip();
2367     if (init_n  != NULL &&  init_n->is_Con())
2368       tty->print(" [%d,", cl->init_trip()->get_int());
2369     else
2370       tty->print(" [int,");


2381 
2382     if (cl->is_pre_loop ()) tty->print(" pre" );
2383     if (cl->is_main_loop()) tty->print(" main");
2384     if (cl->is_post_loop()) tty->print(" post");
2385     if (cl->is_vectorized_loop()) tty->print(" vector");
2386     if (cl->range_checks_present()) tty->print(" rc ");
2387     if (cl->is_multiversioned()) tty->print(" multi ");
2388   }
2389   if (_has_call) tty->print(" has_call");
2390   if (_has_sfpt) tty->print(" has_sfpt");
2391   if (_rce_candidate) tty->print(" rce");
2392   if (_safepts != NULL && _safepts->size() > 0) {
2393     tty->print(" sfpts={"); _safepts->dump_simple(); tty->print(" }");
2394   }
2395   if (_required_safept != NULL && _required_safept->size() > 0) {
2396     tty->print(" req={"); _required_safept->dump_simple(); tty->print(" }");
2397   }
2398   if (Verbose) {
2399     tty->print(" body={"); _body.dump_simple(); tty->print(" }");
2400   }
2401   if (_head->as_Loop()->is_strip_mined()) {
2402     tty->print(" strip_mined");
2403   }
2404   tty->cr();
2405 }
2406 
2407 //------------------------------dump-------------------------------------------
2408 // Dump loops by loop tree
2409 void IdealLoopTree::dump( ) const {
2410   dump_head();
2411   if (_child) _child->dump();
2412   if (_next)  _next ->dump();
2413 }
2414 
2415 #endif
2416 
2417 static void log_loop_tree(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
2418   if (loop == root) {
2419     if (loop->_child != NULL) {
2420       log->begin_head("loop_tree");
2421       log->end_head();




2330     // Not a counted loop. Keep one safepoint.
2331     bool keep_one_sfpt = true;
2332     remove_safepoints(phase, keep_one_sfpt);
2333   }
2334 
2335   // Recursively
2336   assert(loop->_child != this || (loop->_head->as_Loop()->is_OuterStripMinedLoop() && _head->as_CountedLoop()->is_strip_mined()), "what kind of loop was added?");
2337   assert(loop->_child != this || (loop->_child->_child == NULL && loop->_child->_next == NULL), "would miss some loops");
2338   if (loop->_child && loop->_child != this) loop->_child->counted_loop(phase);
2339   if (loop->_next)  loop->_next ->counted_loop(phase);
2340 }
2341 
2342 #ifndef PRODUCT
2343 //------------------------------dump_head--------------------------------------
2344 // Dump 1 liner for loop header info
2345 void IdealLoopTree::dump_head( ) const {
2346   for (uint i=0; i<_nest; i++)
2347     tty->print("  ");
2348   tty->print("Loop: N%d/N%d ",_head->_idx,_tail->_idx);
2349   if (_irreducible) tty->print(" IRREDUCIBLE");
2350   Node* entry = _head->is_Loop() ? _head->as_Loop()->skip_strip_mined(-1)->in(LoopNode::EntryControl) : _head->in(LoopNode::EntryControl);
2351   Node* predicate = PhaseIdealLoop::find_predicate_insertion_point(entry, Deoptimization::Reason_loop_limit_check);
2352   if (predicate != NULL ) {
2353     tty->print(" limit_check");
2354     entry = entry->in(0)->in(0);
2355   }
2356   if (UseLoopPredicate) {
2357     entry = PhaseIdealLoop::find_predicate_insertion_point(entry, Deoptimization::Reason_predicate);
2358     if (entry != NULL) {
2359       tty->print(" predicated");
2360     }
2361   }
2362   if (_head->is_CountedLoop()) {
2363     CountedLoopNode *cl = _head->as_CountedLoop();
2364     tty->print(" counted");
2365 
2366     Node* init_n = cl->init_trip();
2367     if (init_n  != NULL &&  init_n->is_Con())
2368       tty->print(" [%d,", cl->init_trip()->get_int());
2369     else
2370       tty->print(" [int,");


2381 
2382     if (cl->is_pre_loop ()) tty->print(" pre" );
2383     if (cl->is_main_loop()) tty->print(" main");
2384     if (cl->is_post_loop()) tty->print(" post");
2385     if (cl->is_vectorized_loop()) tty->print(" vector");
2386     if (cl->range_checks_present()) tty->print(" rc ");
2387     if (cl->is_multiversioned()) tty->print(" multi ");
2388   }
2389   if (_has_call) tty->print(" has_call");
2390   if (_has_sfpt) tty->print(" has_sfpt");
2391   if (_rce_candidate) tty->print(" rce");
2392   if (_safepts != NULL && _safepts->size() > 0) {
2393     tty->print(" sfpts={"); _safepts->dump_simple(); tty->print(" }");
2394   }
2395   if (_required_safept != NULL && _required_safept->size() > 0) {
2396     tty->print(" req={"); _required_safept->dump_simple(); tty->print(" }");
2397   }
2398   if (Verbose) {
2399     tty->print(" body={"); _body.dump_simple(); tty->print(" }");
2400   }
2401   if (_head->is_Loop() && _head->as_Loop()->is_strip_mined()) {
2402     tty->print(" strip_mined");
2403   }
2404   tty->cr();
2405 }
2406 
2407 //------------------------------dump-------------------------------------------
2408 // Dump loops by loop tree
2409 void IdealLoopTree::dump( ) const {
2410   dump_head();
2411   if (_child) _child->dump();
2412   if (_next)  _next ->dump();
2413 }
2414 
2415 #endif
2416 
2417 static void log_loop_tree(IdealLoopTree* root, IdealLoopTree* loop, CompileLog* log) {
2418   if (loop == root) {
2419     if (loop->_child != NULL) {
2420       log->begin_head("loop_tree");
2421       log->end_head();


< prev index next >