< prev index next >

src/share/vm/opto/node.cpp

Print this page




1135 
1136 // Some nodes have specific Ideal subgraph transformations only if they are
1137 // unique users of specific nodes. Such nodes should be put on IGVN worklist
1138 // for the transformations to happen.
1139 bool Node::has_special_unique_user() const {
1140   assert(outcnt() == 1, "match only for unique out");
1141   Node* n = unique_out();
1142   int op  = Opcode();
1143   if (this->is_Store()) {
1144     // Condition for back-to-back stores folding.
1145     return n->Opcode() == op && n->in(MemNode::Memory) == this;
1146   } else if (this->is_Load()) {
1147     // Condition for removing an unused LoadNode from the MemBarAcquire precedence input
1148     return n->Opcode() == Op_MemBarAcquire;
1149   } else if (op == Op_AddL) {
1150     // Condition for convL2I(addL(x,y)) ==> addI(convL2I(x),convL2I(y))
1151     return n->Opcode() == Op_ConvL2I && n->in(1) == this;
1152   } else if (op == Op_SubI || op == Op_SubL) {
1153     // Condition for subI(x,subI(y,z)) ==> subI(addI(x,z),y)
1154     return n->Opcode() == op && n->in(2) == this;
1155   } else if (is_If() && (n->is_IfFalse() || n->is_IfTrue())) {
1156     // See IfProjNode::Identity()
1157     return true;
1158   }
1159   return false;
1160 };
1161 
1162 //--------------------------find_exact_control---------------------------------
1163 // Skip Proj and CatchProj nodes chains. Check for Null and Top.
1164 Node* Node::find_exact_control(Node* ctrl) {
1165   if (ctrl == NULL && this->is_Region())
1166     ctrl = this->as_Region()->is_copy();
1167 
1168   if (ctrl != NULL && ctrl->is_CatchProj()) {
1169     if (ctrl->as_CatchProj()->_con == CatchProjNode::fall_through_index)
1170       ctrl = ctrl->in(0);
1171     if (ctrl != NULL && !ctrl->is_top())
1172       ctrl = ctrl->in(0);
1173   }
1174 
1175   if (ctrl != NULL && ctrl->is_Proj())
1176     ctrl = ctrl->in(0);
1177 




1135 
1136 // Some nodes have specific Ideal subgraph transformations only if they are
1137 // unique users of specific nodes. Such nodes should be put on IGVN worklist
1138 // for the transformations to happen.
1139 bool Node::has_special_unique_user() const {
1140   assert(outcnt() == 1, "match only for unique out");
1141   Node* n = unique_out();
1142   int op  = Opcode();
1143   if (this->is_Store()) {
1144     // Condition for back-to-back stores folding.
1145     return n->Opcode() == op && n->in(MemNode::Memory) == this;
1146   } else if (this->is_Load()) {
1147     // Condition for removing an unused LoadNode from the MemBarAcquire precedence input
1148     return n->Opcode() == Op_MemBarAcquire;
1149   } else if (op == Op_AddL) {
1150     // Condition for convL2I(addL(x,y)) ==> addI(convL2I(x),convL2I(y))
1151     return n->Opcode() == Op_ConvL2I && n->in(1) == this;
1152   } else if (op == Op_SubI || op == Op_SubL) {
1153     // Condition for subI(x,subI(y,z)) ==> subI(addI(x,z),y)
1154     return n->Opcode() == op && n->in(2) == this;



1155   }
1156   return false;
1157 };
1158 
1159 //--------------------------find_exact_control---------------------------------
1160 // Skip Proj and CatchProj nodes chains. Check for Null and Top.
1161 Node* Node::find_exact_control(Node* ctrl) {
1162   if (ctrl == NULL && this->is_Region())
1163     ctrl = this->as_Region()->is_copy();
1164 
1165   if (ctrl != NULL && ctrl->is_CatchProj()) {
1166     if (ctrl->as_CatchProj()->_con == CatchProjNode::fall_through_index)
1167       ctrl = ctrl->in(0);
1168     if (ctrl != NULL && !ctrl->is_top())
1169       ctrl = ctrl->in(0);
1170   }
1171 
1172   if (ctrl != NULL && ctrl->is_Proj())
1173     ctrl = ctrl->in(0);
1174 


< prev index next >