< prev index next >

src/hotspot/share/opto/loopopts.cpp

Print this page




 998 }
 999 
1000 static bool merge_point_safe(Node* region) {
1001   // 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode
1002   // having a PhiNode input. This sidesteps the dangerous case where the split
1003   // ConvI2LNode may become TOP if the input Value() does not
1004   // overlap the ConvI2L range, leaving a node which may not dominate its
1005   // uses.
1006   // A better fix for this problem can be found in the BugTraq entry, but
1007   // expediency for Mantis demands this hack.
1008   // 6855164: If the merge point has a FastLockNode with a PhiNode input, we stop
1009   // split_if_with_blocks from splitting a block because we could not move around
1010   // the FastLockNode.
1011   for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
1012     Node* n = region->fast_out(i);
1013     if (n->is_Phi()) {
1014       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
1015         Node* m = n->fast_out(j);
1016         if (m->is_FastLock())
1017           return false;
1018         if (m->is_ValueType()) {
1019           // TODO this breaks optimizations!
1020           // Value types should not be split through phis
1021           //return false;
1022         }
1023 #ifdef _LP64
1024         if (m->Opcode() == Op_ConvI2L)
1025           return false;
1026         if (m->is_CastII() && m->isa_CastII()->has_range_check()) {
1027           return false;
1028         }
1029 #endif
1030       }
1031     }
1032   }
1033   return true;
1034 }
1035 
1036 
1037 //------------------------------place_near_use---------------------------------
1038 // Place some computation next to use but not inside inner loops.
1039 // For inner loop uses move it to the preheader area.
1040 Node *PhaseIdealLoop::place_near_use( Node *useblock ) const {
1041   IdealLoopTree *u_loop = get_loop( useblock );
1042   return (u_loop->_irreducible || u_loop->_child)


1355             // be forced back in the loop.  This is annoying because it
1356             // makes +VerifyOpto report false-positives on progress.  I
1357             // tried setting control edges on the x's to force them to
1358             // not combine, but the matching gets worried when it tries
1359             // to fold a StoreP and an AddP together (as part of an
1360             // address expression) and the AddP and StoreP have
1361             // different controls.
1362             if (!x->is_Load() && !x->is_DecodeNarrowPtr()) _igvn._worklist.yank(x);
1363           }
1364           _igvn.remove_dead_node(n);
1365         }
1366       }
1367     }
1368   }
1369 
1370   try_move_store_after_loop(n);
1371 
1372   // Remove multiple allocations of the same value type
1373   if (n->is_ValueType() && EliminateAllocations) {
1374     n->as_ValueType()->remove_redundant_allocations(&_igvn, this);

1375   }
1376 
1377   // Check for Opaque2's who's loop has disappeared - who's input is in the
1378   // same loop nest as their output.  Remove 'em, they are no longer useful.
1379   if( n_op == Op_Opaque2 &&
1380       n->in(1) != NULL &&
1381       get_loop(get_ctrl(n)) == get_loop(get_ctrl(n->in(1))) ) {
1382     _igvn.replace_node( n, n->in(1) );
1383   }
1384 }
1385 
1386 //------------------------------split_if_with_blocks---------------------------
1387 // Check for aggressive application of 'split-if' optimization,
1388 // using basic block level info.
1389 void PhaseIdealLoop::split_if_with_blocks( VectorSet &visited, Node_Stack &nstack ) {
1390   Node *n = C->root();
1391   visited.set(n->_idx); // first, mark node as visited
1392   // Do pre-visit work for root
1393   n = split_if_with_blocks_pre( n );
1394   uint cnt = n->outcnt();




 998 }
 999 
1000 static bool merge_point_safe(Node* region) {
1001   // 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode
1002   // having a PhiNode input. This sidesteps the dangerous case where the split
1003   // ConvI2LNode may become TOP if the input Value() does not
1004   // overlap the ConvI2L range, leaving a node which may not dominate its
1005   // uses.
1006   // A better fix for this problem can be found in the BugTraq entry, but
1007   // expediency for Mantis demands this hack.
1008   // 6855164: If the merge point has a FastLockNode with a PhiNode input, we stop
1009   // split_if_with_blocks from splitting a block because we could not move around
1010   // the FastLockNode.
1011   for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
1012     Node* n = region->fast_out(i);
1013     if (n->is_Phi()) {
1014       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
1015         Node* m = n->fast_out(j);
1016         if (m->is_FastLock())
1017           return false;





1018 #ifdef _LP64
1019         if (m->Opcode() == Op_ConvI2L)
1020           return false;
1021         if (m->is_CastII() && m->isa_CastII()->has_range_check()) {
1022           return false;
1023         }
1024 #endif
1025       }
1026     }
1027   }
1028   return true;
1029 }
1030 
1031 
1032 //------------------------------place_near_use---------------------------------
1033 // Place some computation next to use but not inside inner loops.
1034 // For inner loop uses move it to the preheader area.
1035 Node *PhaseIdealLoop::place_near_use( Node *useblock ) const {
1036   IdealLoopTree *u_loop = get_loop( useblock );
1037   return (u_loop->_irreducible || u_loop->_child)


1350             // be forced back in the loop.  This is annoying because it
1351             // makes +VerifyOpto report false-positives on progress.  I
1352             // tried setting control edges on the x's to force them to
1353             // not combine, but the matching gets worried when it tries
1354             // to fold a StoreP and an AddP together (as part of an
1355             // address expression) and the AddP and StoreP have
1356             // different controls.
1357             if (!x->is_Load() && !x->is_DecodeNarrowPtr()) _igvn._worklist.yank(x);
1358           }
1359           _igvn.remove_dead_node(n);
1360         }
1361       }
1362     }
1363   }
1364 
1365   try_move_store_after_loop(n);
1366 
1367   // Remove multiple allocations of the same value type
1368   if (n->is_ValueType() && EliminateAllocations) {
1369     n->as_ValueType()->remove_redundant_allocations(&_igvn, this);
1370     return; // n is now dead
1371   }
1372 
1373   // Check for Opaque2's who's loop has disappeared - who's input is in the
1374   // same loop nest as their output.  Remove 'em, they are no longer useful.
1375   if( n_op == Op_Opaque2 &&
1376       n->in(1) != NULL &&
1377       get_loop(get_ctrl(n)) == get_loop(get_ctrl(n->in(1))) ) {
1378     _igvn.replace_node( n, n->in(1) );
1379   }
1380 }
1381 
1382 //------------------------------split_if_with_blocks---------------------------
1383 // Check for aggressive application of 'split-if' optimization,
1384 // using basic block level info.
1385 void PhaseIdealLoop::split_if_with_blocks( VectorSet &visited, Node_Stack &nstack ) {
1386   Node *n = C->root();
1387   visited.set(n->_idx); // first, mark node as visited
1388   // Do pre-visit work for root
1389   n = split_if_with_blocks_pre( n );
1390   uint cnt = n->outcnt();


< prev index next >