Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/loopopts.cpp @ 293:c3e045194476
6731641: assert(m->adr_type() == mach->adr_type(),"matcher should not change adr type")
Summary: fixed few addP node type and narrow oop type problems.
Reviewed-by: rasbold, never
author | kvn |
---|---|
date | Fri, 01 Aug 2008 10:06:45 -0700 |
parents | b0fe4deeb9fb |
children | 60bc5071073f |
comparison
equal
deleted
inserted
replaced
257:40b69ca33f4b | 293:c3e045194476 |
---|---|
94 // Note that some Identity methods call phase->type(this). | 94 // Note that some Identity methods call phase->type(this). |
95 // Make sure that the type array is big enough for | 95 // Make sure that the type array is big enough for |
96 // our new node, even though we may throw the node away. | 96 // our new node, even though we may throw the node away. |
97 // (Note: This tweaking with igvn only works because x is a new node.) | 97 // (Note: This tweaking with igvn only works because x is a new node.) |
98 _igvn.set_type(x, t); | 98 _igvn.set_type(x, t); |
99 // If x is a TypeNode, capture any more-precise type permanently into Node | |
100 // othewise it will be not updated during igvn->transform since | |
101 // igvn->type(x) is set to x->Value() already. | |
102 x->raise_bottom_type(t); | |
99 Node *y = x->Identity(&_igvn); | 103 Node *y = x->Identity(&_igvn); |
100 if( y != x ) { | 104 if( y != x ) { |
101 wins++; | 105 wins++; |
102 x = y; | 106 x = y; |
103 } else { | 107 } else { |
462 cost++; // Probably encodes as 2 CMOV's | 466 cost++; // Probably encodes as 2 CMOV's |
463 case T_INT: // These all CMOV fine | 467 case T_INT: // These all CMOV fine |
464 case T_FLOAT: | 468 case T_FLOAT: |
465 case T_DOUBLE: | 469 case T_DOUBLE: |
466 case T_ADDRESS: // (RawPtr) | 470 case T_ADDRESS: // (RawPtr) |
467 case T_NARROWOOP: | |
468 cost++; | 471 cost++; |
469 break; | 472 break; |
473 case T_NARROWOOP: // Fall through | |
470 case T_OBJECT: { // Base oops are OK, but not derived oops | 474 case T_OBJECT: { // Base oops are OK, but not derived oops |
471 const TypeOopPtr *tp = phi->type()->isa_oopptr(); | 475 const TypeOopPtr *tp = phi->type()->make_ptr()->isa_oopptr(); |
472 // Derived pointers are Bad (tm): what's the Base (for GC purposes) of a | 476 // Derived pointers are Bad (tm): what's the Base (for GC purposes) of a |
473 // CMOVE'd derived pointer? It's a CMOVE'd derived base. Thus | 477 // CMOVE'd derived pointer? It's a CMOVE'd derived base. Thus |
474 // CMOVE'ing a derived pointer requires we also CMOVE the base. If we | 478 // CMOVE'ing a derived pointer requires we also CMOVE the base. If we |
475 // have a Phi for the base here that we convert to a CMOVE all is well | 479 // have a Phi for the base here that we convert to a CMOVE all is well |
476 // and good. But if the base is dead, we'll not make a CMOVE. Later | 480 // and good. But if the base is dead, we'll not make a CMOVE. Later |
497 for( uint k = 1; k < inp->req(); k++ ) | 501 for( uint k = 1; k < inp->req(); k++ ) |
498 if (get_ctrl(inp->in(k)) == proj) | 502 if (get_ctrl(inp->in(k)) == proj) |
499 return NULL; // Too much speculative goo | 503 return NULL; // Too much speculative goo |
500 } | 504 } |
501 } | 505 } |
502 // See if the Phi is used by a Cmp. This will likely Split-If, a | 506 // See if the Phi is used by a Cmp or Narrow oop Decode/Encode. |
503 // higher-payoff operation. | 507 // This will likely Split-If, a higher-payoff operation. |
504 for (DUIterator_Fast kmax, k = phi->fast_outs(kmax); k < kmax; k++) { | 508 for (DUIterator_Fast kmax, k = phi->fast_outs(kmax); k < kmax; k++) { |
505 Node* use = phi->fast_out(k); | 509 Node* use = phi->fast_out(k); |
506 if( use->is_Cmp() ) | 510 if( use->is_Cmp() || use->is_DecodeN() || use->is_EncodeP() ) |
507 return NULL; | 511 return NULL; |
508 } | 512 } |
509 } | 513 } |
510 if( cost >= ConditionalMoveLimit ) return NULL; // Too much goo | 514 if( cost >= ConditionalMoveLimit ) return NULL; // Too much goo |
511 Node* bol = iff->in(1); | 515 Node* bol = iff->in(1); |