< prev index next >

src/share/vm/opto/superword.cpp

Print this page




2668   //     lim = lim0 + N
2669   Node* lim;
2670   if (stride < 0) {
2671     lim = new SubINode(lim0, N);
2672   } else {
2673     lim = new AddINode(lim0, N);
2674   }
2675   _igvn.register_new_node_with_optimizer(lim);
2676   _phase->set_ctrl(lim, pre_ctrl);
2677   Node* constrained =
2678     (stride > 0) ? (Node*) new MinINode(lim, orig_limit)
2679                  : (Node*) new MaxINode(lim, orig_limit);
2680   _igvn.register_new_node_with_optimizer(constrained);
2681   _phase->set_ctrl(constrained, pre_ctrl);
2682   _igvn.hash_delete(pre_opaq);
2683   pre_opaq->set_req(1, constrained);
2684 }
2685 
2686 //----------------------------get_pre_loop_end---------------------------
2687 // Find pre loop end from main loop.  Returns null if none.
2688 CountedLoopEndNode* SuperWord::get_pre_loop_end(CountedLoopNode *cl) {
2689   Node *ctrl = cl->in(LoopNode::EntryControl);
2690   if (!ctrl->is_IfTrue() && !ctrl->is_IfFalse()) return NULL;
2691   Node *iffm = ctrl->in(0);
2692   if (!iffm->is_If()) return NULL;
2693   Node *p_f = iffm->in(0);










2694   if (!p_f->is_IfFalse()) return NULL;
2695   if (!p_f->in(0)->is_CountedLoopEnd()) return NULL;
2696   CountedLoopEndNode *pre_end = p_f->in(0)->as_CountedLoopEnd();
2697   CountedLoopNode* loop_node = pre_end->loopnode();
2698   if (loop_node == NULL || !loop_node->is_pre_loop()) return NULL;
2699   return pre_end;
2700 }
2701 
2702 
2703 //------------------------------init---------------------------
2704 void SuperWord::init() {
2705   _dg.init();
2706   _packset.clear();
2707   _disjoint_ptrs.clear();
2708   _block.clear();
2709   _data_entry.clear();
2710   _mem_slice_head.clear();
2711   _mem_slice_tail.clear();
2712   _iteration_first.clear();
2713   _iteration_last.clear();
2714   _node_info.clear();
2715   _align_to_ref = NULL;
2716   _lpt = NULL;




2668   //     lim = lim0 + N
2669   Node* lim;
2670   if (stride < 0) {
2671     lim = new SubINode(lim0, N);
2672   } else {
2673     lim = new AddINode(lim0, N);
2674   }
2675   _igvn.register_new_node_with_optimizer(lim);
2676   _phase->set_ctrl(lim, pre_ctrl);
2677   Node* constrained =
2678     (stride > 0) ? (Node*) new MinINode(lim, orig_limit)
2679                  : (Node*) new MaxINode(lim, orig_limit);
2680   _igvn.register_new_node_with_optimizer(constrained);
2681   _phase->set_ctrl(constrained, pre_ctrl);
2682   _igvn.hash_delete(pre_opaq);
2683   pre_opaq->set_req(1, constrained);
2684 }
2685 
2686 //----------------------------get_pre_loop_end---------------------------
2687 // Find pre loop end from main loop.  Returns null if none.
2688 CountedLoopEndNode* SuperWord::get_pre_loop_end(CountedLoopNode* cl) {
2689   Node* ctrl = cl->in(LoopNode::EntryControl);
2690   if (!ctrl->is_IfTrue() && !ctrl->is_IfFalse()) return NULL;
2691   Node* iffm = ctrl->in(0);
2692   if (!iffm->is_If()) return NULL;
2693   Node* bolzm = iffm->in(1);
2694   if (!bolzm->is_Bool()) return NULL;
2695   Node* cmpzm = bolzm->in(1);
2696   if (!cmpzm->is_Cmp()) return NULL;
2697   Node* opqzm = cmpzm->in(2);
2698   // Can not optimize a loop if zero-trip Opaque1 node is optimized
2699   // away and then another round of loop opts attempted.
2700   if (opqzm->Opcode() != Op_Opaque1) {
2701     return NULL;
2702   }
2703   Node* p_f = iffm->in(0);
2704   if (!p_f->is_IfFalse()) return NULL;
2705   if (!p_f->in(0)->is_CountedLoopEnd()) return NULL;
2706   CountedLoopEndNode* pre_end = p_f->in(0)->as_CountedLoopEnd();
2707   CountedLoopNode* loop_node = pre_end->loopnode();
2708   if (loop_node == NULL || !loop_node->is_pre_loop()) return NULL;
2709   return pre_end;
2710 }
2711 
2712 
2713 //------------------------------init---------------------------
2714 void SuperWord::init() {
2715   _dg.init();
2716   _packset.clear();
2717   _disjoint_ptrs.clear();
2718   _block.clear();
2719   _data_entry.clear();
2720   _mem_slice_head.clear();
2721   _mem_slice_tail.clear();
2722   _iteration_first.clear();
2723   _iteration_last.clear();
2724   _node_info.clear();
2725   _align_to_ref = NULL;
2726   _lpt = NULL;


< prev index next >