Mercurial > hg > graal-jvmci-8
comparison src/share/vm/opto/addnode.cpp @ 32:4d428c5b4cb3
6667573: Use set_req_X() in AddPNode::Ideal() for Iterative GVN
Summary: set_req_X() puts dependent nodes on IGVN worklist which allows to improve graph and gives more opportunities for EA scalar replacement.
Reviewed-by: jrose, never
author | kvn |
---|---|
date | Thu, 28 Feb 2008 15:40:09 -0800 |
parents | ff5961f4c095 |
children | 8a4ef4e001d3 |
comparison
equal
deleted
inserted
replaced
31:6152cbb08ce9 | 32:4d428c5b4cb3 |
---|---|
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? |