855 // Generate code to do a loop peel for the given loop (and body). 856 // old_new is a temp array. 857 void do_peeling( IdealLoopTree *loop, Node_List &old_new ); 858 859 // Add pre and post loops around the given loop. These loops are used 860 // during RCE, unrolling and aligning loops. 861 void insert_pre_post_loops( IdealLoopTree *loop, Node_List &old_new, bool peel_only ); 862 // If Node n lives in the back_ctrl block, we clone a private version of n 863 // in preheader_ctrl block and return that, otherwise return n. 864 Node *clone_up_backedge_goo( Node *back_ctrl, Node *preheader_ctrl, Node *n, VectorSet &visited, Node_Stack &clones ); 865 866 // Take steps to maximally unroll the loop. Peel any odd iterations, then 867 // unroll to do double iterations. The next round of major loop transforms 868 // will repeat till the doubled loop body does all remaining iterations in 1 869 // pass. 870 void do_maximally_unroll( IdealLoopTree *loop, Node_List &old_new ); 871 872 // Unroll the loop body one step - make each trip do 2 iterations. 873 void do_unroll( IdealLoopTree *loop, Node_List &old_new, bool adjust_min_trip ); 874 875 // Return true if exp is a constant times an induction var 876 bool is_scaled_iv(Node* exp, Node* iv, int* p_scale); 877 878 // Return true if exp is a scaled induction var plus (or minus) constant 879 bool is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node** p_offset, int depth = 0); 880 881 // Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted 882 ProjNode* create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, 883 Deoptimization::DeoptReason reason); 884 void register_control(Node* n, IdealLoopTree *loop, Node* pred); 885 886 // Clone loop predicates to cloned loops (peeled, unswitched) 887 static ProjNode* clone_predicate(ProjNode* predicate_proj, Node* new_entry, 888 Deoptimization::DeoptReason reason, 889 PhaseIdealLoop* loop_phase, 890 PhaseIterGVN* igvn); 891 892 static Node* clone_loop_predicates(Node* old_entry, Node* new_entry, 893 bool clone_limit_check, 894 PhaseIdealLoop* loop_phase, | 855 // Generate code to do a loop peel for the given loop (and body). 856 // old_new is a temp array. 857 void do_peeling( IdealLoopTree *loop, Node_List &old_new ); 858 859 // Add pre and post loops around the given loop. These loops are used 860 // during RCE, unrolling and aligning loops. 861 void insert_pre_post_loops( IdealLoopTree *loop, Node_List &old_new, bool peel_only ); 862 // If Node n lives in the back_ctrl block, we clone a private version of n 863 // in preheader_ctrl block and return that, otherwise return n. 864 Node *clone_up_backedge_goo( Node *back_ctrl, Node *preheader_ctrl, Node *n, VectorSet &visited, Node_Stack &clones ); 865 866 // Take steps to maximally unroll the loop. Peel any odd iterations, then 867 // unroll to do double iterations. The next round of major loop transforms 868 // will repeat till the doubled loop body does all remaining iterations in 1 869 // pass. 870 void do_maximally_unroll( IdealLoopTree *loop, Node_List &old_new ); 871 872 // Unroll the loop body one step - make each trip do 2 iterations. 873 void do_unroll( IdealLoopTree *loop, Node_List &old_new, bool adjust_min_trip ); 874 875 // Mark vector reduction candidates before loop unrolling 876 void mark_reductions( IdealLoopTree *loop ); 877 878 // Return true if exp is a constant times an induction var 879 bool is_scaled_iv(Node* exp, Node* iv, int* p_scale); 880 881 // Return true if exp is a scaled induction var plus (or minus) constant 882 bool is_scaled_iv_plus_offset(Node* exp, Node* iv, int* p_scale, Node** p_offset, int depth = 0); 883 884 // Create a new if above the uncommon_trap_if_pattern for the predicate to be promoted 885 ProjNode* create_new_if_for_predicate(ProjNode* cont_proj, Node* new_entry, 886 Deoptimization::DeoptReason reason); 887 void register_control(Node* n, IdealLoopTree *loop, Node* pred); 888 889 // Clone loop predicates to cloned loops (peeled, unswitched) 890 static ProjNode* clone_predicate(ProjNode* predicate_proj, Node* new_entry, 891 Deoptimization::DeoptReason reason, 892 PhaseIdealLoop* loop_phase, 893 PhaseIterGVN* igvn); 894 895 static Node* clone_loop_predicates(Node* old_entry, Node* new_entry, 896 bool clone_limit_check, 897 PhaseIdealLoop* loop_phase, |