src/share/vm/opto/ifnode.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8148754-cr Sdiff src/share/vm/opto

src/share/vm/opto/ifnode.cpp

Print this page




1327   if( cmp2_t == TypeInt::ZERO ) flip = 1-flip;
1328 
1329   const Type *phi1_t = phase->type( phi->in(1) );
1330   const Type *phi2_t = phase->type( phi->in(2) );
1331   // Check for Phi(0,1) and flip
1332   if( phi1_t == TypeInt::ZERO ) {
1333     if( phi2_t != TypeInt::ONE ) return NULL;
1334     flip = 1-flip;
1335   } else {
1336     // Check for Phi(1,0)
1337     if( phi1_t != TypeInt::ONE  ) return NULL;
1338     if( phi2_t != TypeInt::ZERO ) return NULL;
1339   }
1340   if( true_path == 2 ) {
1341     flip = 1-flip;
1342   }
1343 
1344   Node* new_bol = (flip ? phase->transform( bol2->negate(phase) ) : bol2);
1345   assert(new_bol != iff->in(1), "must make progress");
1346   iff->set_req(1, new_bol);
1347   // Intervening diamond probably goes dead
1348   phase->C->set_major_progress();
1349   return iff;
1350 }
1351 
1352 static IfNode* idealize_test(PhaseGVN* phase, IfNode* iff);
1353 
1354 struct RangeCheck {
1355   Node* ctl;
1356   jint off;
1357 };
1358 
1359 Node* IfNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
1360   if (remove_dead_region(phase, can_reshape))  return this;
1361   // No Def-Use info?
1362   if (!can_reshape)  return NULL;
1363 
1364   // Don't bother trying to transform a dead if
1365   if (in(0)->is_top())  return NULL;
1366   // Don't bother trying to transform an if with a dead test
1367   if (in(1)->is_top())  return NULL;
1368   // Another variation of a dead test




1327   if( cmp2_t == TypeInt::ZERO ) flip = 1-flip;
1328 
1329   const Type *phi1_t = phase->type( phi->in(1) );
1330   const Type *phi2_t = phase->type( phi->in(2) );
1331   // Check for Phi(0,1) and flip
1332   if( phi1_t == TypeInt::ZERO ) {
1333     if( phi2_t != TypeInt::ONE ) return NULL;
1334     flip = 1-flip;
1335   } else {
1336     // Check for Phi(1,0)
1337     if( phi1_t != TypeInt::ONE  ) return NULL;
1338     if( phi2_t != TypeInt::ZERO ) return NULL;
1339   }
1340   if( true_path == 2 ) {
1341     flip = 1-flip;
1342   }
1343 
1344   Node* new_bol = (flip ? phase->transform( bol2->negate(phase) ) : bol2);
1345   assert(new_bol != iff->in(1), "must make progress");
1346   iff->set_req(1, new_bol);


1347   return iff;
1348 }
1349 
1350 static IfNode* idealize_test(PhaseGVN* phase, IfNode* iff);
1351 
1352 struct RangeCheck {
1353   Node* ctl;
1354   jint off;
1355 };
1356 
1357 Node* IfNode::Ideal_common(PhaseGVN *phase, bool can_reshape) {
1358   if (remove_dead_region(phase, can_reshape))  return this;
1359   // No Def-Use info?
1360   if (!can_reshape)  return NULL;
1361 
1362   // Don't bother trying to transform a dead if
1363   if (in(0)->is_top())  return NULL;
1364   // Don't bother trying to transform an if with a dead test
1365   if (in(1)->is_top())  return NULL;
1366   // Another variation of a dead test


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