Mercurial > hg > truffle
comparison src/share/vm/opto/loopopts.cpp @ 20804:7848fc12602b
Merge with jdk8u40-b25
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Tue, 07 Apr 2015 14:58:49 +0200 |
parents | 52b4284cb496 b6585ac86988 |
children |
comparison
equal
deleted
inserted
replaced
20184:84105dcdb05b | 20804:7848fc12602b |
---|---|
237 return; | 237 return; |
238 | 238 |
239 ProjNode* dp_proj = dp->as_Proj(); | 239 ProjNode* dp_proj = dp->as_Proj(); |
240 ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp_proj->_con)->as_Proj(); | 240 ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp_proj->_con)->as_Proj(); |
241 if (exclude_loop_predicate && | 241 if (exclude_loop_predicate && |
242 unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate)) | 242 (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) || |
243 unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_range_check))) { | |
244 // If this is a range check (IfNode::is_range_check), do not | |
245 // reorder because Compile::allow_range_check_smearing might have | |
246 // changed the check. | |
243 return; // Let IGVN transformation change control dependence. | 247 return; // Let IGVN transformation change control dependence. |
248 } | |
244 | 249 |
245 IdealLoopTree *old_loop = get_loop(dp); | 250 IdealLoopTree *old_loop = get_loop(dp); |
246 | 251 |
247 for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) { | 252 for (DUIterator_Fast imax, i = dp->fast_outs(imax); i < imax; i++) { |
248 Node* cd = dp->fast_out(i); // Control-dependent node | 253 Node* cd = dp->fast_out(i); // Control-dependent node |
732 // Bail out if the region and its phis have too many users. | 737 // Bail out if the region and its phis have too many users. |
733 int weight = 0; | 738 int weight = 0; |
734 for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) { | 739 for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) { |
735 weight += region->fast_out(i)->outcnt(); | 740 weight += region->fast_out(i)->outcnt(); |
736 } | 741 } |
737 int nodes_left = MaxNodeLimit - C->live_nodes(); | 742 int nodes_left = C->max_node_limit() - C->live_nodes(); |
738 if (weight * 8 > nodes_left) { | 743 if (weight * 8 > nodes_left) { |
739 #ifndef PRODUCT | 744 #ifndef PRODUCT |
740 if (PrintOpto) | 745 if (PrintOpto) |
741 tty->print_cr("*** Split-if bails out: %d nodes, region weight %d", C->unique(), weight); | 746 tty->print_cr("*** Split-if bails out: %d nodes, region weight %d", C->unique(), weight); |
742 #endif | 747 #endif |
894 // Check for an IF ready to split; one that has its | 899 // Check for an IF ready to split; one that has its |
895 // condition codes input coming from a Phi at the block start. | 900 // condition codes input coming from a Phi at the block start. |
896 int n_op = n->Opcode(); | 901 int n_op = n->Opcode(); |
897 | 902 |
898 // Check for an IF being dominated by another IF same test | 903 // Check for an IF being dominated by another IF same test |
899 if( n_op == Op_If ) { | 904 if (n_op == Op_If) { |
900 Node *bol = n->in(1); | 905 Node *bol = n->in(1); |
901 uint max = bol->outcnt(); | 906 uint max = bol->outcnt(); |
902 // Check for same test used more than once? | 907 // Check for same test used more than once? |
903 if( n_op == Op_If && max > 1 && bol->is_Bool() ) { | 908 if (max > 1 && bol->is_Bool()) { |
904 // Search up IDOMs to see if this IF is dominated. | 909 // Search up IDOMs to see if this IF is dominated. |
905 Node *cutoff = get_ctrl(bol); | 910 Node *cutoff = get_ctrl(bol); |
906 | 911 |
907 // Now search up IDOMs till cutoff, looking for a dominating test | 912 // Now search up IDOMs till cutoff, looking for a dominating test |
908 Node *prevdom = n; | 913 Node *prevdom = n; |
909 Node *dom = idom(prevdom); | 914 Node *dom = idom(prevdom); |
910 while( dom != cutoff ) { | 915 while (dom != cutoff) { |
911 if( dom->req() > 1 && dom->in(1) == bol && prevdom->in(0) == dom ) { | 916 if (dom->req() > 1 && dom->in(1) == bol && prevdom->in(0) == dom) { |
912 // Replace the dominated test with an obvious true or false. | 917 // Replace the dominated test with an obvious true or false. |
913 // Place it on the IGVN worklist for later cleanup. | 918 // Place it on the IGVN worklist for later cleanup. |
914 C->set_major_progress(); | 919 C->set_major_progress(); |
915 dominated_by( prevdom, n, false, true ); | 920 dominated_by(prevdom, n, false, true); |
916 #ifndef PRODUCT | 921 #ifndef PRODUCT |
917 if( VerifyLoopOptimizations ) verify(); | 922 if( VerifyLoopOptimizations ) verify(); |
918 #endif | 923 #endif |
919 return; | 924 return; |
920 } | 925 } |