1224 } 1225 if(s1_ctrl != NULL && s2_ctrl != NULL) { 1226 if (s1_ctrl->is_Proj()) { 1227 s1_ctrl = s1_ctrl->in(0); 1228 assert(lpt()->is_invariant(s1_ctrl), "must be invariant"); 1229 } 1230 if (s2_ctrl->is_Proj()) { 1231 s2_ctrl = s2_ctrl->in(0); 1232 assert(lpt()->is_invariant(s2_ctrl), "must be invariant"); 1233 } 1234 if (!s1_ctrl->is_RangeCheck() || !s2_ctrl->is_RangeCheck()) { 1235 return false; 1236 } 1237 } 1238 // Control nodes are invariant. However, we have no way of checking whether they resolve 1239 // in an equivalent manner. But, we know that invariant range checks are guaranteed to 1240 // throw before the loop (if they would have thrown). Thus, the loop would not have been reached. 1241 // Therefore, if the control nodes for both are range checks, we accept them to be isomorphic. 1242 for (DUIterator_Fast imax, i = s1->fast_outs(imax); i < imax; i++) { 1243 Node* t1 = s1->fast_out(i); 1244 for (DUIterator_Fast imax, i = s2->fast_outs(imax); i < imax; i++) { 1245 Node* t2 = s2->fast_out(i); 1246 if (VectorNode::is_muladds2i(t1) && VectorNode::is_muladds2i(t2)) { 1247 return true; 1248 } 1249 } 1250 } 1251 } 1252 return false; 1253 } 1254 1255 //------------------------------independent--------------------------- 1256 // Is there no data path from s1 to s2 or s2 to s1? 1257 bool SuperWord::independent(Node* s1, Node* s2) { 1258 // assert(s1->Opcode() == s2->Opcode(), "check isomorphic first"); 1259 int d1 = depth(s1); 1260 int d2 = depth(s2); 1261 if (d1 == d2) return s1 != s2; 1262 Node* deep = d1 > d2 ? s1 : s2; 1263 Node* shallow = d1 > d2 ? s2 : s1; 1264 1265 visited_clear(); | 1224 } 1225 if(s1_ctrl != NULL && s2_ctrl != NULL) { 1226 if (s1_ctrl->is_Proj()) { 1227 s1_ctrl = s1_ctrl->in(0); 1228 assert(lpt()->is_invariant(s1_ctrl), "must be invariant"); 1229 } 1230 if (s2_ctrl->is_Proj()) { 1231 s2_ctrl = s2_ctrl->in(0); 1232 assert(lpt()->is_invariant(s2_ctrl), "must be invariant"); 1233 } 1234 if (!s1_ctrl->is_RangeCheck() || !s2_ctrl->is_RangeCheck()) { 1235 return false; 1236 } 1237 } 1238 // Control nodes are invariant. However, we have no way of checking whether they resolve 1239 // in an equivalent manner. But, we know that invariant range checks are guaranteed to 1240 // throw before the loop (if they would have thrown). Thus, the loop would not have been reached. 1241 // Therefore, if the control nodes for both are range checks, we accept them to be isomorphic. 1242 for (DUIterator_Fast imax, i = s1->fast_outs(imax); i < imax; i++) { 1243 Node* t1 = s1->fast_out(i); 1244 for (DUIterator_Fast jmax, j = s2->fast_outs(jmax); j < jmax; j++) { 1245 Node* t2 = s2->fast_out(j); 1246 if (VectorNode::is_muladds2i(t1) && VectorNode::is_muladds2i(t2)) { 1247 return true; 1248 } 1249 } 1250 } 1251 } 1252 return false; 1253 } 1254 1255 //------------------------------independent--------------------------- 1256 // Is there no data path from s1 to s2 or s2 to s1? 1257 bool SuperWord::independent(Node* s1, Node* s2) { 1258 // assert(s1->Opcode() == s2->Opcode(), "check isomorphic first"); 1259 int d1 = depth(s1); 1260 int d2 = depth(s2); 1261 if (d1 == d2) return s1 != s2; 1262 Node* deep = d1 > d2 ? s1 : s2; 1263 Node* shallow = d1 > d2 ? s2 : s1; 1264 1265 visited_clear(); |