< prev index next >

src/share/vm/opto/loopnode.hpp

Print this page
rev 9032 : 8215265: C2: range check elimination may allow illegal out of bound access
Reviewed-by: thartmann, kvn


 942   // and inserting an if to select fast-slow versions.
 943   ProjNode* create_slow_version_of_loop(IdealLoopTree *loop,
 944                                         Node_List &old_new);
 945 
 946   // Clone loop with an invariant test (that does not exit) and
 947   // insert a clone of the test that selects which version to
 948   // execute.
 949   void do_unswitching (IdealLoopTree *loop, Node_List &old_new);
 950 
 951   // Find candidate "if" for unswitching
 952   IfNode* find_unswitching_candidate(const IdealLoopTree *loop) const;
 953 
 954   // Range Check Elimination uses this function!
 955   // Constrain the main loop iterations so the affine function:
 956   //    low_limit <= scale_con * I + offset  <  upper_limit
 957   // always holds true.  That is, either increase the number of iterations in
 958   // the pre-loop or the post-loop until the condition holds true in the main
 959   // loop.  Scale_con, offset and limit are all loop invariant.
 960   void add_constraint( int stride_con, int scale_con, Node *offset, Node *low_limit, Node *upper_limit, Node *pre_ctrl, Node **pre_limit, Node **main_limit );
 961   // Helper function for add_constraint().
 962   Node* adjust_limit( int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl );
 963 
 964   // Partially peel loop up through last_peel node.
 965   bool partial_peel( IdealLoopTree *loop, Node_List &old_new );
 966 
 967   // Create a scheduled list of nodes control dependent on ctrl set.
 968   void scheduled_nodelist( IdealLoopTree *loop, VectorSet& ctrl, Node_List &sched );
 969   // Has a use in the vector set
 970   bool has_use_in_set( Node* n, VectorSet& vset );
 971   // Has use internal to the vector set (ie. not in a phi at the loop head)
 972   bool has_use_internal_to_set( Node* n, VectorSet& vset, IdealLoopTree *loop );
 973   // clone "n" for uses that are outside of loop
 974   int  clone_for_use_outside_loop( IdealLoopTree *loop, Node* n, Node_List& worklist );
 975   // clone "n" for special uses that are in the not_peeled region
 976   void clone_for_special_use_inside_loop( IdealLoopTree *loop, Node* n,
 977                                           VectorSet& not_peel, Node_List& sink_list, Node_List& worklist );
 978   // Insert phi(lp_entry_val, back_edge_val) at use->in(idx) for loop lp if phi does not already exist
 979   void insert_phi_for_loop( Node* use, uint idx, Node* lp_entry_val, Node* back_edge_val, LoopNode* lp );
 980 #ifdef ASSERT
 981   // Validate the loop partition sets: peel and not_peel
 982   bool is_valid_loop_partition( IdealLoopTree *loop, VectorSet& peel, Node_List& peel_list, VectorSet& not_peel );




 942   // and inserting an if to select fast-slow versions.
 943   ProjNode* create_slow_version_of_loop(IdealLoopTree *loop,
 944                                         Node_List &old_new);
 945 
 946   // Clone loop with an invariant test (that does not exit) and
 947   // insert a clone of the test that selects which version to
 948   // execute.
 949   void do_unswitching (IdealLoopTree *loop, Node_List &old_new);
 950 
 951   // Find candidate "if" for unswitching
 952   IfNode* find_unswitching_candidate(const IdealLoopTree *loop) const;
 953 
 954   // Range Check Elimination uses this function!
 955   // Constrain the main loop iterations so the affine function:
 956   //    low_limit <= scale_con * I + offset  <  upper_limit
 957   // always holds true.  That is, either increase the number of iterations in
 958   // the pre-loop or the post-loop until the condition holds true in the main
 959   // loop.  Scale_con, offset and limit are all loop invariant.
 960   void add_constraint( int stride_con, int scale_con, Node *offset, Node *low_limit, Node *upper_limit, Node *pre_ctrl, Node **pre_limit, Node **main_limit );
 961   // Helper function for add_constraint().
 962   Node* adjust_limit(int stride_con, Node * scale, Node *offset, Node *rc_limit, Node *loop_limit, Node *pre_ctrl, bool round_up);
 963 
 964   // Partially peel loop up through last_peel node.
 965   bool partial_peel( IdealLoopTree *loop, Node_List &old_new );
 966 
 967   // Create a scheduled list of nodes control dependent on ctrl set.
 968   void scheduled_nodelist( IdealLoopTree *loop, VectorSet& ctrl, Node_List &sched );
 969   // Has a use in the vector set
 970   bool has_use_in_set( Node* n, VectorSet& vset );
 971   // Has use internal to the vector set (ie. not in a phi at the loop head)
 972   bool has_use_internal_to_set( Node* n, VectorSet& vset, IdealLoopTree *loop );
 973   // clone "n" for uses that are outside of loop
 974   int  clone_for_use_outside_loop( IdealLoopTree *loop, Node* n, Node_List& worklist );
 975   // clone "n" for special uses that are in the not_peeled region
 976   void clone_for_special_use_inside_loop( IdealLoopTree *loop, Node* n,
 977                                           VectorSet& not_peel, Node_List& sink_list, Node_List& worklist );
 978   // Insert phi(lp_entry_val, back_edge_val) at use->in(idx) for loop lp if phi does not already exist
 979   void insert_phi_for_loop( Node* use, uint idx, Node* lp_entry_val, Node* back_edge_val, LoopNode* lp );
 980 #ifdef ASSERT
 981   // Validate the loop partition sets: peel and not_peel
 982   bool is_valid_loop_partition( IdealLoopTree *loop, VectorSet& peel, Node_List& peel_list, VectorSet& not_peel );


< prev index next >