comparison src/share/vm/opto/loopopts.cpp @ 20701:b6585ac86988

8048170: Test closed/java/text/Normalizer/ConformanceTest.java failed Summary: PhaseIdealLoop::split_if_with_blocks_post() shoulnd't reorder range checks adjusted by range check smearing Reviewed-by: kvn, jrose
author roland
date Thu, 04 Dec 2014 14:34:11 +0100
parents 9e69e8d1c900
children 7848fc12602b 535618ab1c04
comparison
equal deleted inserted replaced
20700:0558eb13dcf3 20701:b6585ac86988
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
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 }