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

src/share/vm/opto/loopopts.cpp

Print this page
rev 5645 : 8027422: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed
Summary: type methods shouldn't always operate on speculative part
Reviewed-by:


1098   for( i = 1; i < phi->req(); i++ ) {
1099     Node *b = phi->in(i);
1100     if( b->is_Phi() ) {
1101       _igvn.replace_input_of(phi, i, clone_iff( b->as_Phi(), loop ));
1102     } else {
1103       assert( b->is_Bool(), "" );
1104     }
1105   }
1106 
1107   Node *sample_bool = phi->in(1);
1108   Node *sample_cmp  = sample_bool->in(1);
1109 
1110   // Make Phis to merge the Cmp's inputs.
1111   PhiNode *phi1 = new (C) PhiNode( phi->in(0), Type::TOP );
1112   PhiNode *phi2 = new (C) PhiNode( phi->in(0), Type::TOP );
1113   for( i = 1; i < phi->req(); i++ ) {
1114     Node *n1 = phi->in(i)->in(1)->in(1);
1115     Node *n2 = phi->in(i)->in(1)->in(2);
1116     phi1->set_req( i, n1 );
1117     phi2->set_req( i, n2 );
1118     phi1->set_type( phi1->type()->meet(n1->bottom_type()) );
1119     phi2->set_type( phi2->type()->meet(n2->bottom_type()) );
1120   }
1121   // See if these Phis have been made before.
1122   // Register with optimizer
1123   Node *hit1 = _igvn.hash_find_insert(phi1);
1124   if( hit1 ) {                  // Hit, toss just made Phi
1125     _igvn.remove_dead_node(phi1); // Remove new phi
1126     assert( hit1->is_Phi(), "" );
1127     phi1 = (PhiNode*)hit1;      // Use existing phi
1128   } else {                      // Miss
1129     _igvn.register_new_node_with_optimizer(phi1);
1130   }
1131   Node *hit2 = _igvn.hash_find_insert(phi2);
1132   if( hit2 ) {                  // Hit, toss just made Phi
1133     _igvn.remove_dead_node(phi2); // Remove new phi
1134     assert( hit2->is_Phi(), "" );
1135     phi2 = (PhiNode*)hit2;      // Use existing phi
1136   } else {                      // Miss
1137     _igvn.register_new_node_with_optimizer(phi2);
1138   }
1139   // Register Phis with loop/block info


1172       assert( b->is_Cmp() || b->is_top(), "inputs are all Cmp or TOP" );
1173     }
1174   }
1175 
1176   Node *sample_cmp = phi->in(1);
1177 
1178   // Make Phis to merge the Cmp's inputs.
1179   PhiNode *phi1 = new (C) PhiNode( phi->in(0), Type::TOP );
1180   PhiNode *phi2 = new (C) PhiNode( phi->in(0), Type::TOP );
1181   for( uint j = 1; j < phi->req(); j++ ) {
1182     Node *cmp_top = phi->in(j); // Inputs are all Cmp or TOP
1183     Node *n1, *n2;
1184     if( cmp_top->is_Cmp() ) {
1185       n1 = cmp_top->in(1);
1186       n2 = cmp_top->in(2);
1187     } else {
1188       n1 = n2 = cmp_top;
1189     }
1190     phi1->set_req( j, n1 );
1191     phi2->set_req( j, n2 );
1192     phi1->set_type( phi1->type()->meet(n1->bottom_type()) );
1193     phi2->set_type( phi2->type()->meet(n2->bottom_type()) );
1194   }
1195 
1196   // See if these Phis have been made before.
1197   // Register with optimizer
1198   Node *hit1 = _igvn.hash_find_insert(phi1);
1199   if( hit1 ) {                  // Hit, toss just made Phi
1200     _igvn.remove_dead_node(phi1); // Remove new phi
1201     assert( hit1->is_Phi(), "" );
1202     phi1 = (PhiNode*)hit1;      // Use existing phi
1203   } else {                      // Miss
1204     _igvn.register_new_node_with_optimizer(phi1);
1205   }
1206   Node *hit2 = _igvn.hash_find_insert(phi2);
1207   if( hit2 ) {                  // Hit, toss just made Phi
1208     _igvn.remove_dead_node(phi2); // Remove new phi
1209     assert( hit2->is_Phi(), "" );
1210     phi2 = (PhiNode*)hit2;      // Use existing phi
1211   } else {                      // Miss
1212     _igvn.register_new_node_with_optimizer(phi2);
1213   }




1098   for( i = 1; i < phi->req(); i++ ) {
1099     Node *b = phi->in(i);
1100     if( b->is_Phi() ) {
1101       _igvn.replace_input_of(phi, i, clone_iff( b->as_Phi(), loop ));
1102     } else {
1103       assert( b->is_Bool(), "" );
1104     }
1105   }
1106 
1107   Node *sample_bool = phi->in(1);
1108   Node *sample_cmp  = sample_bool->in(1);
1109 
1110   // Make Phis to merge the Cmp's inputs.
1111   PhiNode *phi1 = new (C) PhiNode( phi->in(0), Type::TOP );
1112   PhiNode *phi2 = new (C) PhiNode( phi->in(0), Type::TOP );
1113   for( i = 1; i < phi->req(); i++ ) {
1114     Node *n1 = phi->in(i)->in(1)->in(1);
1115     Node *n2 = phi->in(i)->in(1)->in(2);
1116     phi1->set_req( i, n1 );
1117     phi2->set_req( i, n2 );
1118     phi1->set_type( phi1->type()->meet(n1->bottom_type(), true));
1119     phi2->set_type( phi2->type()->meet(n2->bottom_type(), true));
1120   }
1121   // See if these Phis have been made before.
1122   // Register with optimizer
1123   Node *hit1 = _igvn.hash_find_insert(phi1);
1124   if( hit1 ) {                  // Hit, toss just made Phi
1125     _igvn.remove_dead_node(phi1); // Remove new phi
1126     assert( hit1->is_Phi(), "" );
1127     phi1 = (PhiNode*)hit1;      // Use existing phi
1128   } else {                      // Miss
1129     _igvn.register_new_node_with_optimizer(phi1);
1130   }
1131   Node *hit2 = _igvn.hash_find_insert(phi2);
1132   if( hit2 ) {                  // Hit, toss just made Phi
1133     _igvn.remove_dead_node(phi2); // Remove new phi
1134     assert( hit2->is_Phi(), "" );
1135     phi2 = (PhiNode*)hit2;      // Use existing phi
1136   } else {                      // Miss
1137     _igvn.register_new_node_with_optimizer(phi2);
1138   }
1139   // Register Phis with loop/block info


1172       assert( b->is_Cmp() || b->is_top(), "inputs are all Cmp or TOP" );
1173     }
1174   }
1175 
1176   Node *sample_cmp = phi->in(1);
1177 
1178   // Make Phis to merge the Cmp's inputs.
1179   PhiNode *phi1 = new (C) PhiNode( phi->in(0), Type::TOP );
1180   PhiNode *phi2 = new (C) PhiNode( phi->in(0), Type::TOP );
1181   for( uint j = 1; j < phi->req(); j++ ) {
1182     Node *cmp_top = phi->in(j); // Inputs are all Cmp or TOP
1183     Node *n1, *n2;
1184     if( cmp_top->is_Cmp() ) {
1185       n1 = cmp_top->in(1);
1186       n2 = cmp_top->in(2);
1187     } else {
1188       n1 = n2 = cmp_top;
1189     }
1190     phi1->set_req( j, n1 );
1191     phi2->set_req( j, n2 );
1192     phi1->set_type(phi1->type()->meet(n1->bottom_type(), true));
1193     phi2->set_type(phi2->type()->meet(n2->bottom_type(), true));
1194   }
1195 
1196   // See if these Phis have been made before.
1197   // Register with optimizer
1198   Node *hit1 = _igvn.hash_find_insert(phi1);
1199   if( hit1 ) {                  // Hit, toss just made Phi
1200     _igvn.remove_dead_node(phi1); // Remove new phi
1201     assert( hit1->is_Phi(), "" );
1202     phi1 = (PhiNode*)hit1;      // Use existing phi
1203   } else {                      // Miss
1204     _igvn.register_new_node_with_optimizer(phi1);
1205   }
1206   Node *hit2 = _igvn.hash_find_insert(phi2);
1207   if( hit2 ) {                  // Hit, toss just made Phi
1208     _igvn.remove_dead_node(phi2); // Remove new phi
1209     assert( hit2->is_Phi(), "" );
1210     phi2 = (PhiNode*)hit2;      // Use existing phi
1211   } else {                      // Miss
1212     _igvn.register_new_node_with_optimizer(phi2);
1213   }


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