hotspot/src/share/vm/opto/loopTransform.cpp
changeset 30593 69f942690128
parent 30211 442fbbb31f75
child 31048 ad1dfe0256a7
equal deleted inserted replaced
30592:fa0ae17a543e 30593:69f942690128
     1 /*
     1 /*
     2  * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  1208     } else {
  1208     } else {
  1209       tty->print("Unroll %d     ", loop_head->unrolled_count()*2);
  1209       tty->print("Unroll %d     ", loop_head->unrolled_count()*2);
  1210     }
  1210     }
  1211     loop->dump_head();
  1211     loop->dump_head();
  1212   }
  1212   }
       
  1213 
       
  1214   if (C->do_vector_loop() && (PrintOpto && VerifyLoopOptimizations || TraceLoopOpts)) {
       
  1215     Arena* arena = Thread::current()->resource_area();
       
  1216     Node_Stack stack(arena, C->unique() >> 2);
       
  1217     Node_List rpo_list;
       
  1218     VectorSet visited(arena);
       
  1219     visited.set(loop_head->_idx);
       
  1220     rpo( loop_head, stack, visited, rpo_list );
       
  1221     dump(loop, rpo_list.size(), rpo_list );
       
  1222   }
  1213 #endif
  1223 #endif
  1214 
  1224 
  1215   // Remember loop node count before unrolling to detect
  1225   // Remember loop node count before unrolling to detect
  1216   // if rounds of unroll,optimize are making progress
  1226   // if rounds of unroll,optimize are making progress
  1217   loop_head->set_node_count_before_unroll(loop->_body.size());
  1227   loop_head->set_node_count_before_unroll(loop->_body.size());
  1495     if (!has_ctrl(old))
  1505     if (!has_ctrl(old))
  1496       set_loop(nnn, loop);
  1506       set_loop(nnn, loop);
  1497   }
  1507   }
  1498 
  1508 
  1499   loop->record_for_igvn();
  1509   loop->record_for_igvn();
       
  1510 
       
  1511 #ifndef PRODUCT
       
  1512   if (C->do_vector_loop() && (PrintOpto && VerifyLoopOptimizations || TraceLoopOpts)) {
       
  1513     tty->print("\nnew loop after unroll\n");       loop->dump_head();
       
  1514     for (uint i = 0; i < loop->_body.size(); i++) {
       
  1515       loop->_body.at(i)->dump();
       
  1516     }
       
  1517     if(C->clone_map().is_debug()) {
       
  1518       tty->print("\nCloneMap\n");
       
  1519       Dict* dict = C->clone_map().dict();
       
  1520       DictI i(dict);
       
  1521       tty->print_cr("Dict@%p[%d] = ", dict, dict->Size());
       
  1522       for (int ii = 0; i.test(); ++i, ++ii) {
       
  1523         NodeCloneInfo cl((uint64_t)dict->operator[]((void*)i._key));
       
  1524         tty->print("%d->%d:%d,", (int)(intptr_t)i._key, cl.idx(), cl.gen());
       
  1525         if (ii % 10 == 9) {
       
  1526           tty->print_cr(" ");
       
  1527         }
       
  1528       }
       
  1529       tty->print_cr(" ");
       
  1530     }
       
  1531   }
       
  1532 #endif
       
  1533 
  1500 }
  1534 }
  1501 
  1535 
  1502 //------------------------------do_maximally_unroll----------------------------
  1536 //------------------------------do_maximally_unroll----------------------------
  1503 
  1537 
  1504 void PhaseIdealLoop::do_maximally_unroll( IdealLoopTree *loop, Node_List &old_new ) {
  1538 void PhaseIdealLoop::do_maximally_unroll( IdealLoopTree *loop, Node_List &old_new ) {