@@ -1023,8 +1023,7 @@ Node *PhaseIdealLoop::split_if_with_blocks_pre( Node *n ) {
10231023 if (n->is_CFG () || n->is_LoadStore ()) {
10241024 return n;
10251025 }
1026- if (n->is_Opaque1 () || // Opaque nodes cannot be mod'd
1027- n_op == Op_Opaque2) {
1026+ if (n->is_Opaque1 ()) { // Opaque nodes cannot be mod'd
10281027 if (!C->major_progress ()) { // If chance of no more loop opts...
10291028 _igvn._worklist .push (n); // maybe we'll remove them
10301029 }
@@ -1426,14 +1425,6 @@ void PhaseIdealLoop::split_if_with_blocks_post(Node *n) {
14261425 try_sink_out_of_loop (n);
14271426
14281427 try_move_store_after_loop (n);
1429-
1430- // Check for Opaque2's who's loop has disappeared - who's input is in the
1431- // same loop nest as their output. Remove 'em, they are no longer useful.
1432- if ( n_op == Op_Opaque2 &&
1433- n->in (1 ) != NULL &&
1434- get_loop (get_ctrl (n)) == get_loop (get_ctrl (n->in (1 ))) ) {
1435- _igvn.replace_node ( n, n->in (1 ) );
1436- }
14371428}
14381429
14391430// Transform:
@@ -4106,89 +4097,3 @@ bool PhaseIdealLoop::duplicate_loop_backedge(IdealLoopTree *loop, Node_List &old
41064097
41074098 return true ;
41084099}
4109-
4110- // ------------------------------reorg_offsets----------------------------------
4111- // Reorganize offset computations to lower register pressure. Mostly
4112- // prevent loop-fallout uses of the pre-incremented trip counter (which are
4113- // then alive with the post-incremented trip counter forcing an extra
4114- // register move):
4115- //
4116- // iv Phi iv Phi
4117- // | |
4118- // | AddI (+stride)
4119- // | |
4120- // | Opaque2 # Blocks IGVN from folding these nodes until loop opts are over.
4121- // | ====> |
4122- // | AddI (-stride)
4123- // | |
4124- // | CastII # Preserve type of iv Phi
4125- // | |
4126- // Outside Use Outside Use
4127- //
4128- void PhaseIdealLoop::reorg_offsets (IdealLoopTree *loop) {
4129- // Perform it only for canonical counted loops.
4130- // Loop's shape could be messed up by iteration_split_impl.
4131- if (!loop->_head ->is_CountedLoop ())
4132- return ;
4133- if (!loop->_head ->as_Loop ()->is_valid_counted_loop (T_INT))
4134- return ;
4135-
4136- CountedLoopNode *cl = loop->_head ->as_CountedLoop ();
4137- CountedLoopEndNode *cle = cl->loopexit ();
4138- Node *exit = cle->proj_out (false );
4139- Node *phi = cl->phi ();
4140-
4141- // Check for the special case when using the pre-incremented trip-counter on
4142- // the fall-out path (forces the pre-incremented and post-incremented trip
4143- // counter to be live at the same time). Fix this by adjusting to use the
4144- // post-increment trip counter.
4145-
4146- bool progress = true ;
4147- while (progress) {
4148- progress = false ;
4149- for (DUIterator_Fast imax, i = phi->fast_outs (imax); i < imax; i++) {
4150- Node* use = phi->fast_out (i); // User of trip-counter
4151- if (!has_ctrl (use)) continue ;
4152- Node *u_ctrl = get_ctrl (use);
4153- if (use->is_Phi ()) {
4154- u_ctrl = NULL ;
4155- for (uint j = 1 ; j < use->req (); j++)
4156- if (use->in (j) == phi)
4157- u_ctrl = dom_lca (u_ctrl, use->in (0 )->in (j));
4158- }
4159- IdealLoopTree *u_loop = get_loop (u_ctrl);
4160- // Look for loop-invariant use
4161- if (u_loop == loop) continue ;
4162- if (loop->is_member (u_loop)) continue ;
4163- // Check that use is live out the bottom. Assuming the trip-counter
4164- // update is right at the bottom, uses of of the loop middle are ok.
4165- if (dom_lca (exit, u_ctrl) != exit) continue ;
4166- // Hit! Refactor use to use the post-incremented tripcounter.
4167- // Compute a post-increment tripcounter.
4168- Node* c = exit;
4169- if (cl->is_strip_mined ()) {
4170- IdealLoopTree* outer_loop = get_loop (cl->outer_loop ());
4171- if (!outer_loop->is_member (u_loop)) {
4172- c = cl->outer_loop_exit ();
4173- }
4174- }
4175- Node *opaq = new Opaque2Node (C, cle->incr ());
4176- register_new_node (opaq, c);
4177- Node *neg_stride = _igvn.intcon (-cle->stride_con ());
4178- set_ctrl (neg_stride, C->root ());
4179- Node *post = new AddINode (opaq, neg_stride);
4180- register_new_node (post , c);
4181- post = new CastIINode (post , phi->bottom_type ()); // preserve the iv phi's type
4182- register_new_node (post , c);
4183- _igvn.rehash_node_delayed (use);
4184- for (uint j = 1 ; j < use->req (); j++) {
4185- if (use->in (j) == phi)
4186- use->set_req (j, post );
4187- }
4188- // Since DU info changed, rerun loop
4189- progress = true ;
4190- break ;
4191- }
4192- }
4193-
4194- }
0 commit comments