< prev index next >

src/hotspot/share/opto/loopopts.cpp

Print this page




 515         IdealLoopTree* loop1 = get_loop(get_ctrl(mul_in1));
 516         IdealLoopTree* loop2 = get_loop(get_ctrl(mul_in2));
 517         IdealLoopTree* loop3 = get_loop(get_ctrl(mul_in3));
 518         IdealLoopTree* loop4 = get_loop(get_ctrl(mul_in4));
 519         IdealLoopTree* loop5 = get_loop(get_ctrl(in1));
 520         IdealLoopTree* loop6 = get_loop(get_ctrl(in2));
 521         // All nodes should be in the same counted loop.
 522         if (loop_n == loop1 && loop_n == loop2 && loop_n == loop3 &&
 523             loop_n == loop4 && loop_n == loop5 && loop_n == loop6) {
 524           Node* adr1 = mul_in1->in(MemNode::Address);
 525           Node* adr2 = mul_in2->in(MemNode::Address);
 526           Node* adr3 = mul_in3->in(MemNode::Address);
 527           Node* adr4 = mul_in4->in(MemNode::Address);
 528           if (adr1->is_AddP() && adr2->is_AddP() && adr3->is_AddP() && adr4->is_AddP()) {
 529             if ((adr1->in(AddPNode::Base) == adr3->in(AddPNode::Base)) &&
 530                 (adr2->in(AddPNode::Base) == adr4->in(AddPNode::Base))) {
 531               nn = new MulAddS2INode(mul_in1, mul_in2, mul_in3, mul_in4);
 532               register_new_node(nn, get_ctrl(n));
 533               _igvn.replace_node(n, nn);
 534               return nn;






 535             }
 536           }
 537         }
 538       }
 539     }
 540   }
 541   return nn;
 542 }
 543 
 544 //------------------------------conditional_move-------------------------------
 545 // Attempt to replace a Phi with a conditional move.  We have some pretty
 546 // strict profitability requirements.  All Phis at the merge point must
 547 // be converted, so we can remove the control flow.  We need to limit the
 548 // number of c-moves to a small handful.  All code that was in the side-arms
 549 // of the CFG diamond is now speculatively executed.  This code has to be
 550 // "cheap enough".  We are pretty much limited to CFG diamonds that merge
 551 // 1 or 2 items with a total of 1 or 2 ops executed speculatively.
 552 Node *PhaseIdealLoop::conditional_move( Node *region ) {
 553 
 554   assert(region->is_Region(), "sanity check");




 515         IdealLoopTree* loop1 = get_loop(get_ctrl(mul_in1));
 516         IdealLoopTree* loop2 = get_loop(get_ctrl(mul_in2));
 517         IdealLoopTree* loop3 = get_loop(get_ctrl(mul_in3));
 518         IdealLoopTree* loop4 = get_loop(get_ctrl(mul_in4));
 519         IdealLoopTree* loop5 = get_loop(get_ctrl(in1));
 520         IdealLoopTree* loop6 = get_loop(get_ctrl(in2));
 521         // All nodes should be in the same counted loop.
 522         if (loop_n == loop1 && loop_n == loop2 && loop_n == loop3 &&
 523             loop_n == loop4 && loop_n == loop5 && loop_n == loop6) {
 524           Node* adr1 = mul_in1->in(MemNode::Address);
 525           Node* adr2 = mul_in2->in(MemNode::Address);
 526           Node* adr3 = mul_in3->in(MemNode::Address);
 527           Node* adr4 = mul_in4->in(MemNode::Address);
 528           if (adr1->is_AddP() && adr2->is_AddP() && adr3->is_AddP() && adr4->is_AddP()) {
 529             if ((adr1->in(AddPNode::Base) == adr3->in(AddPNode::Base)) &&
 530                 (adr2->in(AddPNode::Base) == adr4->in(AddPNode::Base))) {
 531               nn = new MulAddS2INode(mul_in1, mul_in2, mul_in3, mul_in4);
 532               register_new_node(nn, get_ctrl(n));
 533               _igvn.replace_node(n, nn);
 534               return nn;
 535             } else if ((adr1->in(AddPNode::Base) == adr4->in(AddPNode::Base)) &&
 536                        (adr2->in(AddPNode::Base) == adr3->in(AddPNode::Base))) {
 537               nn = new MulAddS2INode(mul_in1, mul_in2, mul_in4, mul_in3);
 538               register_new_node(nn, get_ctrl(n));
 539               _igvn.replace_node(n, nn);
 540               return nn;
 541             }
 542           }
 543         }
 544       }
 545     }
 546   }
 547   return nn;
 548 }
 549 
 550 //------------------------------conditional_move-------------------------------
 551 // Attempt to replace a Phi with a conditional move.  We have some pretty
 552 // strict profitability requirements.  All Phis at the merge point must
 553 // be converted, so we can remove the control flow.  We need to limit the
 554 // number of c-moves to a small handful.  All code that was in the side-arms
 555 // of the CFG diamond is now speculatively executed.  This code has to be
 556 // "cheap enough".  We are pretty much limited to CFG diamonds that merge
 557 // 1 or 2 items with a total of 1 or 2 ops executed speculatively.
 558 Node *PhaseIdealLoop::conditional_move( Node *region ) {
 559 
 560   assert(region->is_Region(), "sanity check");


< prev index next >