< prev index next >

src/share/vm/opto/loopopts.cpp

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "opto/addnode.hpp"

  28 #include "opto/connode.hpp"
  29 #include "opto/castnode.hpp"
  30 #include "opto/divnode.hpp"
  31 #include "opto/loopnode.hpp"
  32 #include "opto/matcher.hpp"
  33 #include "opto/mulnode.hpp"
  34 #include "opto/movenode.hpp"
  35 #include "opto/opaquenode.hpp"
  36 #include "opto/rootnode.hpp"
  37 #include "opto/subnode.hpp"
  38 
  39 //=============================================================================
  40 //------------------------------split_thru_phi---------------------------------
  41 // Split Node 'n' through merge point if there is enough win.
  42 Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) {
  43   if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::LONG) {
  44     // ConvI2L may have type information on it which is unsafe to push up
  45     // so disable this for now
  46     return NULL;
  47   }


 980   // 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode
 981   // having a PhiNode input. This sidesteps the dangerous case where the split
 982   // ConvI2LNode may become TOP if the input Value() does not
 983   // overlap the ConvI2L range, leaving a node which may not dominate its
 984   // uses.
 985   // A better fix for this problem can be found in the BugTraq entry, but
 986   // expediency for Mantis demands this hack.
 987   // 6855164: If the merge point has a FastLockNode with a PhiNode input, we stop
 988   // split_if_with_blocks from splitting a block because we could not move around
 989   // the FastLockNode.
 990   for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
 991     Node* n = region->fast_out(i);
 992     if (n->is_Phi()) {
 993       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
 994         Node* m = n->fast_out(j);
 995         if (m->is_FastLock())
 996           return false;
 997 #ifdef _LP64
 998         if (m->Opcode() == Op_ConvI2L)
 999           return false;



1000 #endif
1001       }
1002     }
1003   }
1004   return true;
1005 }
1006 
1007 
1008 //------------------------------place_near_use---------------------------------
1009 // Place some computation next to use but not inside inner loops.
1010 // For inner loop uses move it to the preheader area.
1011 Node *PhaseIdealLoop::place_near_use( Node *useblock ) const {
1012   IdealLoopTree *u_loop = get_loop( useblock );
1013   return (u_loop->_irreducible || u_loop->_child)
1014     ? useblock
1015     : u_loop->_head->in(LoopNode::EntryControl);
1016 }
1017 
1018 
1019 //------------------------------split_if_with_blocks_post----------------------




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "memory/allocation.inline.hpp"
  27 #include "opto/addnode.hpp"
  28 #include "opto/castnode.hpp"
  29 #include "opto/connode.hpp"
  30 #include "opto/castnode.hpp"
  31 #include "opto/divnode.hpp"
  32 #include "opto/loopnode.hpp"
  33 #include "opto/matcher.hpp"
  34 #include "opto/mulnode.hpp"
  35 #include "opto/movenode.hpp"
  36 #include "opto/opaquenode.hpp"
  37 #include "opto/rootnode.hpp"
  38 #include "opto/subnode.hpp"
  39 
  40 //=============================================================================
  41 //------------------------------split_thru_phi---------------------------------
  42 // Split Node 'n' through merge point if there is enough win.
  43 Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) {
  44   if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::LONG) {
  45     // ConvI2L may have type information on it which is unsafe to push up
  46     // so disable this for now
  47     return NULL;
  48   }


 981   // 4799512: Stop split_if_with_blocks from splitting a block with a ConvI2LNode
 982   // having a PhiNode input. This sidesteps the dangerous case where the split
 983   // ConvI2LNode may become TOP if the input Value() does not
 984   // overlap the ConvI2L range, leaving a node which may not dominate its
 985   // uses.
 986   // A better fix for this problem can be found in the BugTraq entry, but
 987   // expediency for Mantis demands this hack.
 988   // 6855164: If the merge point has a FastLockNode with a PhiNode input, we stop
 989   // split_if_with_blocks from splitting a block because we could not move around
 990   // the FastLockNode.
 991   for (DUIterator_Fast imax, i = region->fast_outs(imax); i < imax; i++) {
 992     Node* n = region->fast_out(i);
 993     if (n->is_Phi()) {
 994       for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) {
 995         Node* m = n->fast_out(j);
 996         if (m->is_FastLock())
 997           return false;
 998 #ifdef _LP64
 999         if (m->Opcode() == Op_ConvI2L)
1000           return false;
1001         if (m->is_CastII() && m->isa_CastII()->has_range_check()) {
1002           return false;
1003         }
1004 #endif
1005       }
1006     }
1007   }
1008   return true;
1009 }
1010 
1011 
1012 //------------------------------place_near_use---------------------------------
1013 // Place some computation next to use but not inside inner loops.
1014 // For inner loop uses move it to the preheader area.
1015 Node *PhaseIdealLoop::place_near_use( Node *useblock ) const {
1016   IdealLoopTree *u_loop = get_loop( useblock );
1017   return (u_loop->_irreducible || u_loop->_child)
1018     ? useblock
1019     : u_loop->_head->in(LoopNode::EntryControl);
1020 }
1021 
1022 
1023 //------------------------------split_if_with_blocks_post----------------------


< prev index next >