comparison src/share/vm/opto/gcm.cpp @ 8883:b9a918201d47

Merge with hsx25
author Gilles Duboscq <duboscq@ssw.jku.at>
date Sat, 06 Apr 2013 20:04:06 +0200
parents 571076d3c79d
children d1034bd8cefc d2907f74462e
comparison
equal deleted inserted replaced
8660:d47b52b0ff68 8883:b9a918201d47
1044 end_latency, 1044 end_latency,
1045 least_freq); 1045 least_freq);
1046 } 1046 }
1047 #endif 1047 #endif
1048 1048
1049 int cand_cnt = 0; // number of candidates tried
1050
1049 // Walk up the dominator tree from LCA (Lowest common ancestor) to 1051 // Walk up the dominator tree from LCA (Lowest common ancestor) to
1050 // the earliest legal location. Capture the least execution frequency. 1052 // the earliest legal location. Capture the least execution frequency.
1051 while (LCA != early) { 1053 while (LCA != early) {
1052 LCA = LCA->_idom; // Follow up the dominator tree 1054 LCA = LCA->_idom; // Follow up the dominator tree
1053 1055
1069 if (trace_opto_pipelining()) { 1071 if (trace_opto_pipelining()) {
1070 tty->print_cr("# B%d: start latency for [%4d]=%d, end latency for [%4d]=%d, freq=%g", 1072 tty->print_cr("# B%d: start latency for [%4d]=%d, end latency for [%4d]=%d, freq=%g",
1071 LCA->_pre_order, LCA->_nodes[0]->_idx, start_lat, end_idx, end_lat, LCA_freq); 1073 LCA->_pre_order, LCA->_nodes[0]->_idx, start_lat, end_idx, end_lat, LCA_freq);
1072 } 1074 }
1073 #endif 1075 #endif
1076 cand_cnt++;
1074 if (LCA_freq < least_freq || // Better Frequency 1077 if (LCA_freq < least_freq || // Better Frequency
1075 ( !in_latency && // No block containing latency 1078 (StressGCM && Compile::randomized_select(cand_cnt)) || // Should be randomly accepted in stress mode
1079 (!StressGCM && // Otherwise, choose with latency
1080 !in_latency && // No block containing latency
1076 LCA_freq < least_freq * delta && // No worse frequency 1081 LCA_freq < least_freq * delta && // No worse frequency
1077 target >= end_lat && // within latency range 1082 target >= end_lat && // within latency range
1078 !self->is_iteratively_computed() ) // But don't hoist IV increments 1083 !self->is_iteratively_computed() ) // But don't hoist IV increments
1079 // because they may end up above other uses of their phi forcing 1084 // because they may end up above other uses of their phi forcing
1080 // their result register to be different from their input. 1085 // their result register to be different from their input.
1208 } 1213 }
1209 return; 1214 return;
1210 } 1215 }
1211 1216
1212 // If there is no opportunity to hoist, then we're done. 1217 // If there is no opportunity to hoist, then we're done.
1213 bool try_to_hoist = (LCA != early); 1218 // In stress mode, try to hoist even the single operations.
1219 bool try_to_hoist = StressGCM || (LCA != early);
1214 1220
1215 // Must clone guys stay next to use; no hoisting allowed. 1221 // Must clone guys stay next to use; no hoisting allowed.
1216 // Also cannot hoist guys that alter memory or are otherwise not 1222 // Also cannot hoist guys that alter memory or are otherwise not
1217 // allocatable (hoisting can make a value live longer, leading to 1223 // allocatable (hoisting can make a value live longer, leading to
1218 // anti and output dependency problems which are normally resolved 1224 // anti and output dependency problems which are normally resolved