503 if( t12->is_con() ) { // Left input is an add of a constant? |
503 if( t12->is_con() ) { // Left input is an add of a constant? |
504 // If the right input is a constant, combine constants |
504 // If the right input is a constant, combine constants |
505 const Type *temp_t2 = phase->type( in(Offset) ); |
505 const Type *temp_t2 = phase->type( in(Offset) ); |
506 if( temp_t2 == Type::TOP ) return NULL; |
506 if( temp_t2 == Type::TOP ) return NULL; |
507 const TypeX *t2 = temp_t2->is_intptr_t(); |
507 const TypeX *t2 = temp_t2->is_intptr_t(); |
|
508 Node* address; |
|
509 Node* offset; |
508 if( t2->is_con() ) { |
510 if( t2->is_con() ) { |
509 // The Add of the flattened expression |
511 // The Add of the flattened expression |
510 set_req(Address, addp->in(Address)); |
512 address = addp->in(Address); |
511 set_req(Offset , phase->MakeConX(t2->get_con() + t12->get_con())); |
513 offset = phase->MakeConX(t2->get_con() + t12->get_con()); |
512 return this; // Made progress |
514 } else { |
|
515 // Else move the constant to the right. ((A+con)+B) into ((A+B)+con) |
|
516 address = phase->transform(new (phase->C, 4) AddPNode(in(Base),addp->in(Address),in(Offset))); |
|
517 offset = addp->in(Offset); |
513 } |
518 } |
514 // Else move the constant to the right. ((A+con)+B) into ((A+B)+con) |
519 PhaseIterGVN *igvn = phase->is_IterGVN(); |
515 set_req(Address, phase->transform(new (phase->C, 4) AddPNode(in(Base),addp->in(Address),in(Offset)))); |
520 if( igvn ) { |
516 set_req(Offset , addp->in(Offset)); |
521 set_req_X(Address,address,igvn); |
|
522 set_req_X(Offset,offset,igvn); |
|
523 } else { |
|
524 set_req(Address,address); |
|
525 set_req(Offset,offset); |
|
526 } |
517 return this; |
527 return this; |
518 } |
528 } |
519 } |
529 } |
520 |
530 |
521 // Raw pointers? |
531 // Raw pointers? |