src/share/vm/opto/loopopts.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6924097 Sdiff src/share/vm/opto

src/share/vm/opto/loopopts.cpp

Print this page


   1 /*
   2  * Copyright 1999-2009 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *


  30 // Split Node 'n' through merge point if there is enough win.
  31 Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) {
  32   if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::LONG) {
  33     // ConvI2L may have type information on it which is unsafe to push up
  34     // so disable this for now
  35     return NULL;
  36   }
  37   int wins = 0;
  38   assert( !n->is_CFG(), "" );
  39   assert( region->is_Region(), "" );
  40 
  41   const Type* type = n->bottom_type();
  42   const TypeOopPtr *t_oop = _igvn.type(n)->isa_oopptr();
  43   Node *phi;
  44   if( t_oop != NULL && t_oop->is_known_instance_field() ) {
  45     int iid    = t_oop->instance_id();
  46     int index  = C->get_alias_index(t_oop);
  47     int offset = t_oop->offset();
  48     phi = new (C,region->req()) PhiNode(region, type, NULL, iid, index, offset);
  49   } else {
  50     phi = new (C,region->req()) PhiNode(region, type);
  51   }
  52   uint old_unique = C->unique();
  53   for( uint i = 1; i < region->req(); i++ ) {
  54     Node *x;
  55     Node* the_clone = NULL;
  56     if( region->in(i) == C->top() ) {
  57       x = C->top();             // Dead path?  Use a dead data op
  58     } else {
  59       x = n->clone();           // Else clone up the data op
  60       the_clone = x;            // Remember for possible deletion.
  61       // Alter data node to use pre-phi inputs
  62       if( n->in(0) == region )
  63         x->set_req( 0, region->in(i) );
  64       for( uint j = 1; j < n->req(); j++ ) {
  65         Node *in = n->in(j);
  66         if( in->is_Phi() && in->in(0) == region )
  67           x->set_req( j, in->in(i) ); // Use pre-Phi input for the clone
  68       }
  69     }
  70     // Check for a 'win' on some paths


   1 /*
   2  * Copyright 1999-2010 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *


  30 // Split Node 'n' through merge point if there is enough win.
  31 Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) {
  32   if (n->Opcode() == Op_ConvI2L && n->bottom_type() != TypeLong::LONG) {
  33     // ConvI2L may have type information on it which is unsafe to push up
  34     // so disable this for now
  35     return NULL;
  36   }
  37   int wins = 0;
  38   assert( !n->is_CFG(), "" );
  39   assert( region->is_Region(), "" );
  40 
  41   const Type* type = n->bottom_type();
  42   const TypeOopPtr *t_oop = _igvn.type(n)->isa_oopptr();
  43   Node *phi;
  44   if( t_oop != NULL && t_oop->is_known_instance_field() ) {
  45     int iid    = t_oop->instance_id();
  46     int index  = C->get_alias_index(t_oop);
  47     int offset = t_oop->offset();
  48     phi = new (C,region->req()) PhiNode(region, type, NULL, iid, index, offset);
  49   } else {
  50     phi = PhiNode::make_blank(region, n);
  51   }
  52   uint old_unique = C->unique();
  53   for( uint i = 1; i < region->req(); i++ ) {
  54     Node *x;
  55     Node* the_clone = NULL;
  56     if( region->in(i) == C->top() ) {
  57       x = C->top();             // Dead path?  Use a dead data op
  58     } else {
  59       x = n->clone();           // Else clone up the data op
  60       the_clone = x;            // Remember for possible deletion.
  61       // Alter data node to use pre-phi inputs
  62       if( n->in(0) == region )
  63         x->set_req( 0, region->in(i) );
  64       for( uint j = 1; j < n->req(); j++ ) {
  65         Node *in = n->in(j);
  66         if( in->is_Phi() && in->in(0) == region )
  67           x->set_req( j, in->in(i) ); // Use pre-Phi input for the clone
  68       }
  69     }
  70     // Check for a 'win' on some paths


src/share/vm/opto/loopopts.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File