< prev index next >

src/share/vm/opto/ifnode.cpp

Print this page
rev 10656 : [backport] Purge some G1-related cruft in C2


1214   } else {
1215     // Cannot call transform on it just yet
1216     igvn->set_type_bottom(iff);
1217   }
1218   igvn->_worklist.push(iff);
1219 
1220   // Now handle projections.  Cloning not required.
1221   Node* new_if_f = (Node*)(new (phase->C) IfFalseNode( iff ));
1222   Node* new_if_t = (Node*)(new (phase->C) IfTrueNode ( iff ));
1223 
1224   igvn->register_new_node_with_optimizer(new_if_f);
1225   igvn->register_new_node_with_optimizer(new_if_t);
1226   // Flip test, so flip trailing control
1227   igvn->replace_node(old_if_f, new_if_t);
1228   igvn->replace_node(old_if_t, new_if_f);
1229 
1230   // Progress
1231   return iff;
1232 }
1233 
1234 bool IfNode::is_g1_marking_if(PhaseTransform *phase) const {
1235   if (Opcode() != Op_If) {
1236     return false;
1237   }
1238 
1239   Node* bol = in(1);
1240   assert(bol->is_Bool(), "");
1241   Node* cmpx = bol->in(1);
1242   if (bol->as_Bool()->_test._test == BoolTest::ne &&
1243       cmpx->is_Cmp() && cmpx->in(2) == phase->intcon(0) &&
1244       cmpx->in(1)->is_g1_marking_load()) {
1245     return true;
1246   }
1247   return false;
1248 }
1249 
1250 //------------------------------Identity---------------------------------------
1251 // If the test is constant & we match, then we are the input Control
1252 Node *IfFalseNode::Identity( PhaseTransform *phase ) {
1253   // Can only optimize if cannot go the other way
1254   const TypeTuple *t = phase->type(in(0))->is_tuple();
1255   return ( t == TypeTuple::IFNEITHER || t == TypeTuple::IFFALSE )
1256     ? in(0)->in(0)              // IfNode control
1257     : this;                     // no progress
1258 }


1214   } else {
1215     // Cannot call transform on it just yet
1216     igvn->set_type_bottom(iff);
1217   }
1218   igvn->_worklist.push(iff);
1219 
1220   // Now handle projections.  Cloning not required.
1221   Node* new_if_f = (Node*)(new (phase->C) IfFalseNode( iff ));
1222   Node* new_if_t = (Node*)(new (phase->C) IfTrueNode ( iff ));
1223 
1224   igvn->register_new_node_with_optimizer(new_if_f);
1225   igvn->register_new_node_with_optimizer(new_if_t);
1226   // Flip test, so flip trailing control
1227   igvn->replace_node(old_if_f, new_if_t);
1228   igvn->replace_node(old_if_t, new_if_f);
1229 
1230   // Progress
1231   return iff;
1232 }
1233 
















1234 //------------------------------Identity---------------------------------------
1235 // If the test is constant & we match, then we are the input Control
1236 Node *IfFalseNode::Identity( PhaseTransform *phase ) {
1237   // Can only optimize if cannot go the other way
1238   const TypeTuple *t = phase->type(in(0))->is_tuple();
1239   return ( t == TypeTuple::IFNEITHER || t == TypeTuple::IFFALSE )
1240     ? in(0)->in(0)              // IfNode control
1241     : this;                     // no progress
1242 }
< prev index next >