Mercurial > hg > truffle
comparison src/share/vm/opto/loopopts.cpp @ 18041:52b4284cb496
Merge with jdk8u20-b26
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Wed, 15 Oct 2014 16:02:50 +0200 |
parents | 89152779163c 4077c61b03a0 |
children | 7848fc12602b |
comparison
equal
deleted
inserted
replaced
17606:45d7b2c7029d | 18041:52b4284cb496 |
---|---|
38 // Split Node 'n' through merge point if there is enough win. | 38 // Split Node 'n' through merge point if there is enough win. |
39 Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) { | 39 Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) { |
40 if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::LONG) { | 40 if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::LONG) { |
41 // ConvI2L may have type information on it which is unsafe to push up | 41 // ConvI2L may have type information on it which is unsafe to push up |
42 // so disable this for now | 42 // so disable this for now |
43 return NULL; | |
44 } | |
45 | |
46 if (n->is_MathExact()) { | |
47 // MathExact has projections that are not correctly handled in the code | |
48 // below. | |
49 return NULL; | 43 return NULL; |
50 } | 44 } |
51 | 45 |
52 int wins = 0; | 46 int wins = 0; |
53 assert(!n->is_CFG(), ""); | 47 assert(!n->is_CFG(), ""); |
1113 for( i = 1; i < phi->req(); i++ ) { | 1107 for( i = 1; i < phi->req(); i++ ) { |
1114 Node *n1 = phi->in(i)->in(1)->in(1); | 1108 Node *n1 = phi->in(i)->in(1)->in(1); |
1115 Node *n2 = phi->in(i)->in(1)->in(2); | 1109 Node *n2 = phi->in(i)->in(1)->in(2); |
1116 phi1->set_req( i, n1 ); | 1110 phi1->set_req( i, n1 ); |
1117 phi2->set_req( i, n2 ); | 1111 phi2->set_req( i, n2 ); |
1118 phi1->set_type( phi1->type()->meet(n1->bottom_type()) ); | 1112 phi1->set_type( phi1->type()->meet_speculative(n1->bottom_type())); |
1119 phi2->set_type( phi2->type()->meet(n2->bottom_type()) ); | 1113 phi2->set_type( phi2->type()->meet_speculative(n2->bottom_type())); |
1120 } | 1114 } |
1121 // See if these Phis have been made before. | 1115 // See if these Phis have been made before. |
1122 // Register with optimizer | 1116 // Register with optimizer |
1123 Node *hit1 = _igvn.hash_find_insert(phi1); | 1117 Node *hit1 = _igvn.hash_find_insert(phi1); |
1124 if( hit1 ) { // Hit, toss just made Phi | 1118 if( hit1 ) { // Hit, toss just made Phi |
1187 } else { | 1181 } else { |
1188 n1 = n2 = cmp_top; | 1182 n1 = n2 = cmp_top; |
1189 } | 1183 } |
1190 phi1->set_req( j, n1 ); | 1184 phi1->set_req( j, n1 ); |
1191 phi2->set_req( j, n2 ); | 1185 phi2->set_req( j, n2 ); |
1192 phi1->set_type( phi1->type()->meet(n1->bottom_type()) ); | 1186 phi1->set_type(phi1->type()->meet_speculative(n1->bottom_type())); |
1193 phi2->set_type( phi2->type()->meet(n2->bottom_type()) ); | 1187 phi2->set_type(phi2->type()->meet_speculative(n2->bottom_type())); |
1194 } | 1188 } |
1195 | 1189 |
1196 // See if these Phis have been made before. | 1190 // See if these Phis have been made before. |
1197 // Register with optimizer | 1191 // Register with optimizer |
1198 Node *hit1 = _igvn.hash_find_insert(phi1); | 1192 Node *hit1 = _igvn.hash_find_insert(phi1); |
1405 // If the Data use is an IF, that means we have an IF outside of the | 1399 // If the Data use is an IF, that means we have an IF outside of the |
1406 // loop that is switching on a condition that is set inside of the | 1400 // loop that is switching on a condition that is set inside of the |
1407 // loop. Happens if people set a loop-exit flag; then test the flag | 1401 // loop. Happens if people set a loop-exit flag; then test the flag |
1408 // in the loop to break the loop, then test is again outside of the | 1402 // in the loop to break the loop, then test is again outside of the |
1409 // loop to determine which way the loop exited. | 1403 // loop to determine which way the loop exited. |
1410 if( use->is_If() || use->is_CMove() ) { | 1404 // Loop predicate If node connects to Bool node through Opaque1 node. |
1405 if (use->is_If() || use->is_CMove() || C->is_predicate_opaq(use)) { | |
1411 // Since this code is highly unlikely, we lazily build the worklist | 1406 // Since this code is highly unlikely, we lazily build the worklist |
1412 // of such Nodes to go split. | 1407 // of such Nodes to go split. |
1413 if( !split_if_set ) | 1408 if( !split_if_set ) |
1414 split_if_set = new Node_List(area); | 1409 split_if_set = new Node_List(area); |
1415 split_if_set->push(use); | 1410 split_if_set->push(use); |
2360 int opc = n->Opcode(); | 2355 int opc = n->Opcode(); |
2361 if (n->is_Call() || | 2356 if (n->is_Call() || |
2362 opc == Op_Catch || | 2357 opc == Op_Catch || |
2363 opc == Op_CatchProj || | 2358 opc == Op_CatchProj || |
2364 opc == Op_Jump || | 2359 opc == Op_Jump || |
2365 opc == Op_JumpProj || | 2360 opc == Op_JumpProj) { |
2366 opc == Op_FlagsProj) { | |
2367 #if !defined(PRODUCT) | 2361 #if !defined(PRODUCT) |
2368 if (TracePartialPeeling) { | 2362 if (TracePartialPeeling) { |
2369 tty->print_cr("\nExit control too complex: lp: %d", head->_idx); | 2363 tty->print_cr("\nExit control too complex: lp: %d", head->_idx); |
2370 } | 2364 } |
2371 #endif | 2365 #endif |
2703 recompute_dom_depth(); | 2697 recompute_dom_depth(); |
2704 | 2698 |
2705 // Inhibit more partial peeling on this loop | 2699 // Inhibit more partial peeling on this loop |
2706 new_head_clone->set_partial_peel_loop(); | 2700 new_head_clone->set_partial_peel_loop(); |
2707 C->set_major_progress(); | 2701 C->set_major_progress(); |
2702 loop->record_for_igvn(); | |
2708 | 2703 |
2709 #if !defined(PRODUCT) | 2704 #if !defined(PRODUCT) |
2710 if (TracePartialPeeling) { | 2705 if (TracePartialPeeling) { |
2711 tty->print_cr("\nafter partial peel one iteration"); | 2706 tty->print_cr("\nafter partial peel one iteration"); |
2712 Node_List wl(area); | 2707 Node_List wl(area); |
2772 // update is right at the bottom, uses of of the loop middle are ok. | 2767 // update is right at the bottom, uses of of the loop middle are ok. |
2773 if (dom_lca(exit, u_ctrl) != exit) continue; | 2768 if (dom_lca(exit, u_ctrl) != exit) continue; |
2774 // Hit! Refactor use to use the post-incremented tripcounter. | 2769 // Hit! Refactor use to use the post-incremented tripcounter. |
2775 // Compute a post-increment tripcounter. | 2770 // Compute a post-increment tripcounter. |
2776 Node *opaq = new (C) Opaque2Node( C, cle->incr() ); | 2771 Node *opaq = new (C) Opaque2Node( C, cle->incr() ); |
2777 register_new_node( opaq, u_ctrl ); | 2772 register_new_node(opaq, exit); |
2778 Node *neg_stride = _igvn.intcon(-cle->stride_con()); | 2773 Node *neg_stride = _igvn.intcon(-cle->stride_con()); |
2779 set_ctrl(neg_stride, C->root()); | 2774 set_ctrl(neg_stride, C->root()); |
2780 Node *post = new (C) AddINode( opaq, neg_stride); | 2775 Node *post = new (C) AddINode( opaq, neg_stride); |
2781 register_new_node( post, u_ctrl ); | 2776 register_new_node(post, exit); |
2782 _igvn.rehash_node_delayed(use); | 2777 _igvn.rehash_node_delayed(use); |
2783 for (uint j = 1; j < use->req(); j++) { | 2778 for (uint j = 1; j < use->req(); j++) { |
2784 if (use->in(j) == phi) | 2779 if (use->in(j) == phi) |
2785 use->set_req(j, post); | 2780 use->set_req(j, post); |
2786 } | 2781 } |