< prev index next >

src/hotspot/share/opto/loopnode.hpp

Print this page




 730       // find LCA of all uses
 731       n = dom_lca_for_get_late_ctrl_internal( lca, n, tag );
 732     }
 733     return find_non_split_ctrl(n);
 734   }
 735   Node *dom_lca_for_get_late_ctrl_internal( Node *lca, Node *n, Node *tag );
 736 
 737   // Helper function for directing control inputs away from CFG split
 738   // points.
 739   Node *find_non_split_ctrl( Node *ctrl ) const {
 740     if (ctrl != NULL) {
 741       if (ctrl->is_MultiBranch()) {
 742         ctrl = ctrl->in(0);
 743       }
 744       assert(ctrl->is_CFG(), "CFG");
 745     }
 746     return ctrl;
 747   }
 748 
 749   Node* cast_incr_before_loop(Node* incr, Node* ctrl, Node* loop);
 750   void duplicate_predicates_helper(Node* predicate, Node* castii, IdealLoopTree* outer_loop,
 751                                    LoopNode* outer_main_head, uint dd_main_head);
 752   void duplicate_predicates(CountedLoopNode* pre_head, Node* castii, IdealLoopTree* outer_loop,
 753                             LoopNode* outer_main_head, uint dd_main_head);
 754   Node* update_skeleton_predicate(Node* iff, Node* value, Node* predicate = NULL, Node* uncommon_proj = NULL,
 755                                   Node* current_proj = NULL, IdealLoopTree* outer_loop = NULL, Node* prev_proj = NULL);


 756   void insert_loop_limit_check(ProjNode* limit_check_proj, Node* cmp_limit, Node* bol);
 757 
 758 public:
 759 
 760   PhaseIterGVN &igvn() const { return _igvn; }
 761 
 762   static bool is_canonical_loop_entry(CountedLoopNode* cl);
 763 
 764   bool has_node( Node* n ) const {
 765     guarantee(n != NULL, "No Node.");
 766     return _nodes[n->_idx] != NULL;
 767   }
 768   // check if transform created new nodes that need _ctrl recorded
 769   Node *get_late_ctrl( Node *n, Node *early );
 770   Node *get_early_ctrl( Node *n );
 771   Node *get_early_ctrl_for_expensive(Node *n, Node* earliest);
 772   void set_early_ctrl( Node *n );
 773   void set_subtree_ctrl( Node *root );
 774   void set_ctrl( Node *n, Node *ctrl ) {
 775     assert( !has_node(n) || has_ctrl(n), "" );


1111                          Node* range, bool upper, bool &overflow);
1112 
1113   // Implementation of the loop predication to promote checks outside the loop
1114   bool loop_predication_impl(IdealLoopTree *loop);
1115   bool loop_predication_impl_helper(IdealLoopTree *loop, ProjNode* proj, ProjNode *predicate_proj,
1116                                     CountedLoopNode *cl, ConNode* zero, Invariance& invar,
1117                                     Deoptimization::DeoptReason reason);
1118   bool loop_predication_should_follow_branches(IdealLoopTree *loop, ProjNode *predicate_proj, float& loop_trip_cnt);
1119   void loop_predication_follow_branches(Node *c, IdealLoopTree *loop, float loop_trip_cnt,
1120                                         PathFrequency& pf, Node_Stack& stack, VectorSet& seen,
1121                                         Node_List& if_proj_list);
1122   ProjNode* insert_skeleton_predicate(IfNode* iff, IdealLoopTree *loop,
1123                                       ProjNode* proj, ProjNode *predicate_proj,
1124                                       ProjNode* upper_bound_proj,
1125                                       int scale, Node* offset,
1126                                       Node* init, Node* limit, jint stride,
1127                                       Node* rng, bool& overflow,
1128                                       Deoptimization::DeoptReason reason);
1129   Node* add_range_check_predicate(IdealLoopTree* loop, CountedLoopNode* cl,
1130                                   Node* predicate_proj, int scale_con, Node* offset,
1131                                   Node* limit, jint stride_con);
1132 
1133   // Helper function to collect predicate for eliminating the useless ones
1134   void collect_potentially_useful_predicates(IdealLoopTree *loop, Unique_Node_List &predicate_opaque1);
1135   void eliminate_useless_predicates();
1136 
1137   // Change the control input of expensive nodes to allow commoning by
1138   // IGVN when it is guaranteed to not result in a more frequent
1139   // execution of the expensive node. Return true if progress.
1140   bool process_expensive_nodes();
1141 
1142   // Check whether node has become unreachable
1143   bool is_node_unreachable(Node *n) const {
1144     return !has_node(n) || n->is_unreachable(_igvn);
1145   }
1146 
1147   // Eliminate range-checks and other trip-counter vs loop-invariant tests.
1148   int do_range_check( IdealLoopTree *loop, Node_List &old_new );
1149 
1150   // Check to see if do_range_check(...) cleaned the main loop of range-checks
1151   void has_range_checks(IdealLoopTree *loop);




 730       // find LCA of all uses
 731       n = dom_lca_for_get_late_ctrl_internal( lca, n, tag );
 732     }
 733     return find_non_split_ctrl(n);
 734   }
 735   Node *dom_lca_for_get_late_ctrl_internal( Node *lca, Node *n, Node *tag );
 736 
 737   // Helper function for directing control inputs away from CFG split
 738   // points.
 739   Node *find_non_split_ctrl( Node *ctrl ) const {
 740     if (ctrl != NULL) {
 741       if (ctrl->is_MultiBranch()) {
 742         ctrl = ctrl->in(0);
 743       }
 744       assert(ctrl->is_CFG(), "CFG");
 745     }
 746     return ctrl;
 747   }
 748 
 749   Node* cast_incr_before_loop(Node* incr, Node* ctrl, Node* loop);
 750   void duplicate_predicates_helper(Node* predicate, Node* start, Node* end, IdealLoopTree* outer_loop,
 751                                    LoopNode* outer_main_head, uint dd_main_head);
 752   void duplicate_predicates(CountedLoopNode* pre_head, Node* start, Node* end, IdealLoopTree* outer_loop,
 753                             LoopNode* outer_main_head, uint dd_main_head);
 754   Node* clone_skeleton_predicate(Node* iff, Node* value, Node* predicate, Node* uncommon_proj,
 755                                   Node* current_proj, IdealLoopTree* outer_loop, Node* prev_proj);
 756   bool skeleton_predicate_has_opaque(IfNode* iff);
 757   void update_skeleton_predicates(Node* ctrl, CountedLoopNode* loop_head, Node* init, int stride_con);
 758   void insert_loop_limit_check(ProjNode* limit_check_proj, Node* cmp_limit, Node* bol);
 759 
 760 public:
 761 
 762   PhaseIterGVN &igvn() const { return _igvn; }
 763 
 764   static bool is_canonical_loop_entry(CountedLoopNode* cl);
 765 
 766   bool has_node( Node* n ) const {
 767     guarantee(n != NULL, "No Node.");
 768     return _nodes[n->_idx] != NULL;
 769   }
 770   // check if transform created new nodes that need _ctrl recorded
 771   Node *get_late_ctrl( Node *n, Node *early );
 772   Node *get_early_ctrl( Node *n );
 773   Node *get_early_ctrl_for_expensive(Node *n, Node* earliest);
 774   void set_early_ctrl( Node *n );
 775   void set_subtree_ctrl( Node *root );
 776   void set_ctrl( Node *n, Node *ctrl ) {
 777     assert( !has_node(n) || has_ctrl(n), "" );


1113                          Node* range, bool upper, bool &overflow);
1114 
1115   // Implementation of the loop predication to promote checks outside the loop
1116   bool loop_predication_impl(IdealLoopTree *loop);
1117   bool loop_predication_impl_helper(IdealLoopTree *loop, ProjNode* proj, ProjNode *predicate_proj,
1118                                     CountedLoopNode *cl, ConNode* zero, Invariance& invar,
1119                                     Deoptimization::DeoptReason reason);
1120   bool loop_predication_should_follow_branches(IdealLoopTree *loop, ProjNode *predicate_proj, float& loop_trip_cnt);
1121   void loop_predication_follow_branches(Node *c, IdealLoopTree *loop, float loop_trip_cnt,
1122                                         PathFrequency& pf, Node_Stack& stack, VectorSet& seen,
1123                                         Node_List& if_proj_list);
1124   ProjNode* insert_skeleton_predicate(IfNode* iff, IdealLoopTree *loop,
1125                                       ProjNode* proj, ProjNode *predicate_proj,
1126                                       ProjNode* upper_bound_proj,
1127                                       int scale, Node* offset,
1128                                       Node* init, Node* limit, jint stride,
1129                                       Node* rng, bool& overflow,
1130                                       Deoptimization::DeoptReason reason);
1131   Node* add_range_check_predicate(IdealLoopTree* loop, CountedLoopNode* cl,
1132                                   Node* predicate_proj, int scale_con, Node* offset,
1133                                   Node* limit, jint stride_con, Node* value);
1134 
1135   // Helper function to collect predicate for eliminating the useless ones
1136   void collect_potentially_useful_predicates(IdealLoopTree *loop, Unique_Node_List &predicate_opaque1);
1137   void eliminate_useless_predicates();
1138 
1139   // Change the control input of expensive nodes to allow commoning by
1140   // IGVN when it is guaranteed to not result in a more frequent
1141   // execution of the expensive node. Return true if progress.
1142   bool process_expensive_nodes();
1143 
1144   // Check whether node has become unreachable
1145   bool is_node_unreachable(Node *n) const {
1146     return !has_node(n) || n->is_unreachable(_igvn);
1147   }
1148 
1149   // Eliminate range-checks and other trip-counter vs loop-invariant tests.
1150   int do_range_check( IdealLoopTree *loop, Node_List &old_new );
1151 
1152   // Check to see if do_range_check(...) cleaned the main loop of range-checks
1153   void has_range_checks(IdealLoopTree *loop);


< prev index next >