@@ -117,7 +117,7 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
117
117
// No intervening control, like a simple Call
118
118
Node *r = iff->in (0 );
119
119
if ( !r->is_Region () ) return NULL ;
120
- if (r->is_Loop () && r-> in (LoopNode::LoopBackControl)-> is_top ()) return NULL ; // going away anyway
120
+ if (r->is_Loop ()) return NULL ;
121
121
if ( phi->region () != r ) return NULL ;
122
122
// No other users of the cmp/bool
123
123
if (b->outcnt () != 1 || cmp->outcnt () != 1 ) {
@@ -238,16 +238,13 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
238
238
239
239
// Make a region merging constants and a region merging the rest
240
240
uint req_c = 0 ;
241
- Node* predicate_proj = NULL ;
242
- int nb_predicate_proj = 0 ;
243
241
for (uint ii = 1 ; ii < r->req (); ii++) {
244
242
if (phi->in (ii) == con1) {
245
243
req_c++;
246
244
}
247
245
Node* proj = PhaseIdealLoop::find_predicate (r->in (ii));
248
246
if (proj != NULL ) {
249
- nb_predicate_proj++;
250
- predicate_proj = proj;
247
+ return NULL ;
251
248
}
252
249
}
253
250
@@ -257,24 +254,6 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
257
254
return NULL ;
258
255
}
259
256
260
- if (nb_predicate_proj > 1 ) {
261
- // Can happen in case of loop unswitching and when the loop is
262
- // optimized out: it's not a loop anymore so we don't care about
263
- // predicates.
264
- assert (!r->is_Loop (), " this must not be a loop anymore" );
265
- predicate_proj = NULL ;
266
- }
267
- Node* predicate_c = NULL ;
268
- Node* predicate_x = NULL ;
269
- bool counted_loop = r->is_CountedLoop ();
270
- if (counted_loop) {
271
- // Ignore counted loops for now because the split-if logic does not work
272
- // in all the cases (for example, with strip mined loops). Also, above
273
- // checks only pass for already degraded loops without a tripcount phi
274
- // and these are essentially dead and will go away during igvn.
275
- return NULL ;
276
- }
277
-
278
257
Node *region_c = new RegionNode (req_c + 1 );
279
258
Node *phi_c = con1;
280
259
uint len = r->req ();
@@ -283,23 +262,11 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
283
262
for (uint i = 1 , i_c = 1 , i_x = 1 ; i < len; i++) {
284
263
if (phi->in (i) == con1) {
285
264
region_c->init_req ( i_c++, r ->in (i) );
286
- if (r->in (i) == predicate_proj)
287
- predicate_c = predicate_proj;
288
265
} else {
289
266
region_x->init_req ( i_x, r ->in (i) );
290
267
phi_x ->init_req ( i_x++, phi->in (i) );
291
- if (r->in (i) == predicate_proj)
292
- predicate_x = predicate_proj;
293
268
}
294
269
}
295
- if (predicate_c != NULL && (req_c > 1 )) {
296
- assert (predicate_x == NULL , " only one predicate entry expected" );
297
- predicate_c = NULL ; // Do not clone predicate below merge point
298
- }
299
- if (predicate_x != NULL && ((len - req_c) > 2 )) {
300
- assert (predicate_c == NULL , " only one predicate entry expected" );
301
- predicate_x = NULL ; // Do not clone predicate below merge point
302
- }
303
270
304
271
// Register the new RegionNodes but do not transform them. Cannot
305
272
// transform until the entire Region/Phi conglomerate has been hacked
@@ -341,20 +308,8 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
341
308
// Make the true/false arms
342
309
Node *iff_c_t = phase->transform (new IfTrueNode (iff_c));
343
310
Node *iff_c_f = phase->transform (new IfFalseNode (iff_c));
344
- if (predicate_c != NULL ) {
345
- assert (predicate_x == NULL , " only one predicate entry expected" );
346
- // Clone loop predicates to each path
347
- iff_c_t = igvn->clone_loop_predicates (predicate_c, iff_c_t , !counted_loop);
348
- iff_c_f = igvn->clone_loop_predicates (predicate_c, iff_c_f, !counted_loop);
349
- }
350
311
Node *iff_x_t = phase->transform (new IfTrueNode (iff_x));
351
312
Node *iff_x_f = phase->transform (new IfFalseNode (iff_x));
352
- if (predicate_x != NULL ) {
353
- assert (predicate_c == NULL , " only one predicate entry expected" );
354
- // Clone loop predicates to each path
355
- iff_x_t = igvn->clone_loop_predicates (predicate_x, iff_x_t , !counted_loop);
356
- iff_x_f = igvn->clone_loop_predicates (predicate_x, iff_x_f, !counted_loop);
357
- }
358
313
359
314
// Merge the TRUE paths
360
315
Node *region_s = new RegionNode (3 );
0 commit comments