Lines Matching defs:phi
82 assert(!r->as_Region()->has_phi(), "no phi users");
86 // igvn->hash_delete( phi );
100 // Node *phi = region->out(k);
101 // if( phi->is_Phi() ) {
102 // phi->add_req(phi->in(i));
122 Node* phi = fast_out(i);
123 if (phi->is_Phi()) { // Check for Phi users
124 assert(phi->in(0) == (Node*)this, "phi uses region only via in(0)");
125 return phi->as_Phi(); // this one is good enough
139 Node* phi = fast_out(i);
140 if (phi->is_Phi()) { // Check for Phi users
141 assert(phi->in(0) == (Node*)this, "phi uses region only via in(0)");
143 only_phi = phi->as_Phi();
157 static bool check_phi_clipping( PhiNode *phi, ConNode * &min, uint &min_idx, ConNode * &max, uint &max_idx, Node * &val, uint &val_idx ) {
164 uint phi_max = phi->req();
167 Node *n = phi->in(j);
248 // Verify that the value input to the phi comes from "ConvF2I; LShift; RShift"
249 static bool check_convf2i_clipping( PhiNode *phi, uint idx, ConvF2INode * &convf2i, Node *min, Node *max) {
253 Node *rshift = phi->in(idx);
254 assert( rshift, "Previous checks ensure phi input is present");
259 assert( lshift, "Previous checks ensure phi input is present");
317 Node* phi = raw_out(i);
318 if (phi != NULL && phi->is_Phi()) {
319 assert(phase->eqv(phi->in(0), this) && phi->req() == 2, "");
320 if (phi->outcnt() == 0)
322 if (phi->outcnt() == 1) {
323 Node* u = phi->raw_out(0);
329 // Check when phi references itself directly or through an other node.
330 if (phi->as_Phi()->simple_data_loop_check(phi->in(1)) >= PhiNode::Unsafe)
386 PhiNode* phi = has_unique_phi();
387 if (phi && phi->type() == Type::MEMORY && req() == 3 && phi->is_diamond_phi(true)) {
389 assert(phi->req() == 3, "same as region");
391 Node *mem = phi->in(i);
396 Node* other = phi->in(j);
400 phase->is_IterGVN()->replace_node(phi, m);
633 PhiNode* phi = has_unique_phi();
634 if (phi != NULL) { // One Phi user
642 if( check_phi_clipping( phi, min, min_idx, max, max_idx, val, val_idx ) ) {
658 if( check_convf2i_clipping( phi, val_idx, convf2i, min, max ) &&
678 gvn->hash_delete(phi);
679 phi->set_req_X( val_idx, convf2i, gvn );
680 gvn->hash_find_insert(phi);
727 // create a new phi with edges matching r and set (initially) to x
754 // create a new phi with narrowed memory type
767 // Split out an instance type from a bottom phi.
837 // recheck local phi/phi consistency:
839 "adr_type must be consistent across phi nest");
853 // recheck phi/non-phi consistency at leaves:
856 "adr_type must be consistent at leaves of phi nest");
896 ((const Node*)l->phi() == this) ) { // Trip counted loop!
962 // For example, an input might be a widened int while the phi is a short.
963 // - Inputs might be BotPtrs but this phi is dependent on a null check,
965 // - The type of this phi is an interface, and the inputs are classes.
969 // It is not possible to see Type::BOTTOM values as phi inputs,
1099 // phi->region->if_proj->ifnode->bool->cmp
1131 // It would check for a tributary phi on the backedge that the main phi
1155 // than the phi's type.
1160 // \ / | cast phi cast
1161 // phi \ / / \ /
1162 // phi / --
1214 static Node *is_x2logic( PhaseGVN *phase, PhiNode *phi, int true_path ) {
1221 // phi->region->if_proj->ifnode->bool->cmp
1222 Node *region = phi->in(0);
1227 Node *zero = phi->in(1);
1228 Node *one = phi->in(2);
1273 static Node* is_cond_add(PhaseGVN *phase, PhiNode *phi, int true_path) {
1277 // phi->region->if_proj->ifnode->bool->cmp
1278 RegionNode *region = (RegionNode*)phi->in(0);
1283 // Make sure only merging this one phi here
1284 if (region->has_unique_phi() != phi) return NULL;
1297 Node *n1 = phi->in( true_path);
1298 Node *n2 = phi->in(3-true_path);
1331 int phi_x_idx = 0; // Index of phi input where to find naked x
1338 // phi->region->if_proj->ifnode->bool->cmp
1376 // Check other phi input for subtract node
1403 static void split_once(PhaseIterGVN *igvn, Node *phi, Node *val, Node *n, Node *newn) {
1407 for (uint i = phi->req()-1; i > 0; i--) {
1408 if (phi->in(i) == val) { // Found a path with val?
1427 static Node* split_flow_path(PhaseGVN *phase, PhiNode *phi) {
1428 BasicType bt = phi->type()->basic_type();
1431 if( phi->req() <= 3 ) // Need at least 2 matched inputs and a
1436 for( i = 1; i < phi->req()-1; i++ ) {
1437 Node *n = phi->in(i);
1443 if( i >= phi->req() ) // Only split for constants
1446 Node *val = phi->in(i); // Constant to split for
1448 Node *r = phi->region();
1450 for( ; i < phi->req(); i++ ){ // Count occurrences of constant
1451 Node *n = phi->in(i);
1454 if( phi->in(i) == val ) {
1463 hit == phi->req()-1 ) // and not ALL the same value
1470 split_once(igvn, phi, val, r, newr);
1475 if( phi2->is_Phi() && phi2->as_Phi() != phi ) {
1477 split_once(igvn, phi, val, phi2, newphi);
1482 igvn->hash_delete(phi);
1483 for( i = phi->req()-1; i > 0; i-- ) {
1484 if( phi->in(i) == val ) {
1485 phi->del_req(i);
1488 phi->add_req(val);
1490 return phi;
1495 // Try to determining if the phi node in a simple safe/unsafe data loop.
1498 // Safe - safe case when the phi and it's inputs reference only safe data
1500 // Unsafe - the phi and it's inputs reference unsafe data nodes but there
1501 // is no reference back to the phi - need a graph walk
1503 // UnsafeLoop - unsafe case when the phi references itself directly or through
1509 // as dead loop when the phi references itselfs through an other phi.
1511 // It is unsafe loop if the phi node references itself directly.
1514 // Unsafe loop if the phi node references itself through an unsafe data node.
1518 // Check inputs of phi's inputs also.
1528 // phi->Load/Store->AddP->(ConP ConP Con)/(Parm Parm Con).
1536 // The phi references an unsafe node - need full analysis.
1541 return Safe; // Safe case - we can optimize the phi node.
1545 // If phi can be reached through the data input - it is data loop.
1548 // First, check simple cases when phi references itself directly or
1552 return true; // phi references itself - unsafe loop
1554 return false; // Safe case - phi could be replaced with the unique input.
1557 // if the phi references itself.
1582 return false; // The phi is not reachable from its inputs
1604 // No change for igvn if new phi is not hooked
1608 // The are 2 situations when only one valid phi's input is left
1610 // One: region is not loop - replace phi with this input.
1611 // Two: region is loop - replace phi with top since this data path is dead
1653 // Then, check if there is a data loop when phi references itself directly
1707 // These 4 optimizations could subsume the phi:
1715 // to stop further optimizations for this phi. Identity will return TOP.
1716 assert(req() == 3, "only diamond merge phi here");
1729 // This optimization only modifies phi - don't need to check for dead loop.
1730 assert(opt == NULL || phase->eqv(opt, this), "do not elide phi");
1794 // It will be as if the merged memory is the unique value of the phi.
1799 // see if this phi should be sliced
1818 // Patch the existing phi to select an input from the merge:
1846 // (saw_self == true). If all other inputs also references this phi
1859 return top; // all inputs reference back to this phi - dead loop
1877 // If we have not seen this slice yet, make a phi for it.
1888 Node* phi = mms.memory();
1889 assert(made_new_phi || phi->in(i) == n, "replace the i-th merge by a slice");
1890 phi->set_req(i, mms.memory2());
1897 Node* phi = mms.memory();
1899 if (phi->in(i) == this) phi->set_req(i, phi);
1905 Node* phi = mms.memory();
1906 mms.set_memory(phase->transform(phi));
1933 // Push DecodeN down through phi.
1934 // The rest of phi graph will transform by split EncodeP node though phis up.
1952 // Make narrow type for new phi.
1985 in(0)->as_CountedLoop()->phi() == this);