src/share/vm/opto/loopTransform.cpp

Print this page




  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 "compiler/compileLog.hpp"
  27 #include "memory/allocation.inline.hpp"
  28 #include "opto/addnode.hpp"
  29 #include "opto/callnode.hpp"
  30 #include "opto/connode.hpp"

  31 #include "opto/divnode.hpp"
  32 #include "opto/loopnode.hpp"
  33 #include "opto/mulnode.hpp"


  34 #include "opto/rootnode.hpp"
  35 #include "opto/runtime.hpp"
  36 #include "opto/subnode.hpp"
  37 
  38 //------------------------------is_loop_exit-----------------------------------
  39 // Given an IfNode, return the loop-exiting projection or NULL if both
  40 // arms remain in the loop.
  41 Node *IdealLoopTree::is_loop_exit(Node *iff) const {
  42   if( iff->outcnt() != 2 ) return NULL; // Ignore partially dead tests
  43   PhaseIdealLoop *phase = _phase;
  44   // Test is an IfNode, has 2 projections.  If BOTH are in the loop
  45   // we need loop unswitching instead of peeling.
  46   if( !is_member(phase->get_loop( iff->raw_out(0) )) )
  47     return iff->raw_out(0);
  48   if( !is_member(phase->get_loop( iff->raw_out(1) )) )
  49     return iff->raw_out(1);
  50   return NULL;
  51 }
  52 
  53 




  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 "compiler/compileLog.hpp"
  27 #include "memory/allocation.inline.hpp"
  28 #include "opto/addnode.hpp"
  29 #include "opto/callnode.hpp"
  30 #include "opto/connode.hpp"
  31 #include "opto/convertnode.hpp"
  32 #include "opto/divnode.hpp"
  33 #include "opto/loopnode.hpp"
  34 #include "opto/mulnode.hpp"
  35 #include "opto/movenode.hpp"
  36 #include "opto/opaquenode.hpp"
  37 #include "opto/rootnode.hpp"
  38 #include "opto/runtime.hpp"
  39 #include "opto/subnode.hpp"
  40 
  41 //------------------------------is_loop_exit-----------------------------------
  42 // Given an IfNode, return the loop-exiting projection or NULL if both
  43 // arms remain in the loop.
  44 Node *IdealLoopTree::is_loop_exit(Node *iff) const {
  45   if( iff->outcnt() != 2 ) return NULL; // Ignore partially dead tests
  46   PhaseIdealLoop *phase = _phase;
  47   // Test is an IfNode, has 2 projections.  If BOTH are in the loop
  48   // we need loop unswitching instead of peeling.
  49   if( !is_member(phase->get_loop( iff->raw_out(0) )) )
  50     return iff->raw_out(0);
  51   if( !is_member(phase->get_loop( iff->raw_out(1) )) )
  52     return iff->raw_out(1);
  53   return NULL;
  54 }
  55 
  56