895 // Recompute dom_depth 896 void recompute_dom_depth(); 897 898 // Is safept not required by an outer loop? 899 bool is_deleteable_safept(Node* sfpt); 900 901 // Replace parallel induction variable (parallel to trip counter) 902 void replace_parallel_iv(IdealLoopTree *loop); 903 904 // Perform verification that the graph is valid. 905 PhaseIdealLoop( PhaseIterGVN &igvn) : 906 PhaseTransform(Ideal_Loop), 907 _igvn(igvn), 908 _dom_lca_tags(arena()), // Thread::resource_area 909 _verify_me(NULL), 910 _verify_only(true) { 911 build_and_optimize(false, false); 912 } 913 914 // build the loop tree and perform any requested optimizations 915 void build_and_optimize(bool do_split_if, bool skip_loop_opts); 916 917 // Dominators for the sea of nodes 918 void Dominators(); 919 Node *dom_lca( Node *n1, Node *n2 ) const { 920 return find_non_split_ctrl(dom_lca_internal(n1, n2)); 921 } 922 Node *dom_lca_internal( Node *n1, Node *n2 ) const; 923 924 // Compute the Ideal Node to Loop mapping 925 PhaseIdealLoop( PhaseIterGVN &igvn, bool do_split_ifs, bool skip_loop_opts = false) : 926 PhaseTransform(Ideal_Loop), 927 _igvn(igvn), 928 _dom_lca_tags(arena()), // Thread::resource_area 929 _verify_me(NULL), 930 _verify_only(false) { 931 build_and_optimize(do_split_ifs, skip_loop_opts); 932 } 933 934 // Verify that verify_me made the same decisions as a fresh run. 935 PhaseIdealLoop( PhaseIterGVN &igvn, const PhaseIdealLoop *verify_me) : 936 PhaseTransform(Ideal_Loop), 937 _igvn(igvn), 938 _dom_lca_tags(arena()), // Thread::resource_area 939 _verify_me(verify_me), 940 _verify_only(false) { 941 build_and_optimize(false, false); 942 } 943 944 // Build and verify the loop tree without modifying the graph. This 945 // is useful to verify that all inputs properly dominate their uses. 946 static void verify(PhaseIterGVN& igvn) { 947 #ifdef ASSERT 948 PhaseIdealLoop v(igvn); 949 #endif 950 } 951 1210 Node *clone_iff( PhiNode *phi, IdealLoopTree *loop ); 1211 CmpNode *clone_bool( PhiNode *phi, IdealLoopTree *loop ); 1212 1213 1214 // Rework addressing expressions to get the most loop-invariant stuff 1215 // moved out. We'd like to do all associative operators, but it's especially 1216 // important (common) to do address expressions. 1217 Node *remix_address_expressions( Node *n ); 1218 1219 // Attempt to use a conditional move instead of a phi/branch 1220 Node *conditional_move( Node *n ); 1221 1222 // Reorganize offset computations to lower register pressure. 1223 // Mostly prevent loop-fallout uses of the pre-incremented trip counter 1224 // (which are then alive with the post-incremented trip counter 1225 // forcing an extra register move) 1226 void reorg_offsets( IdealLoopTree *loop ); 1227 1228 // Check for aggressive application of 'split-if' optimization, 1229 // using basic block level info. 1230 void split_if_with_blocks ( VectorSet &visited, Node_Stack &nstack ); 1231 Node *split_if_with_blocks_pre ( Node *n ); 1232 void split_if_with_blocks_post( Node *n ); 1233 Node *has_local_phi_input( Node *n ); 1234 // Mark an IfNode as being dominated by a prior test, 1235 // without actually altering the CFG (and hence IDOM info). 1236 void dominated_by( Node *prevdom, Node *iff, bool flip = false, bool exclude_loop_predicate = false ); 1237 1238 // Split Node 'n' through merge point 1239 Node *split_thru_region( Node *n, Node *region ); 1240 // Split Node 'n' through merge point if there is enough win. 1241 Node *split_thru_phi( Node *n, Node *region, int policy ); 1242 // Found an If getting its condition-code input from a Phi in the 1243 // same block. Split thru the Region. 1244 void do_split_if( Node *iff ); 1245 1246 // Conversion of fill/copy patterns into intrisic versions 1247 bool do_intrinsify_fill(); 1248 bool intrinsify_fill(IdealLoopTree* lpt); 1249 bool match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& store_value, 1250 Node*& shift, Node*& offset); 1251 1252 private: | 895 // Recompute dom_depth 896 void recompute_dom_depth(); 897 898 // Is safept not required by an outer loop? 899 bool is_deleteable_safept(Node* sfpt); 900 901 // Replace parallel induction variable (parallel to trip counter) 902 void replace_parallel_iv(IdealLoopTree *loop); 903 904 // Perform verification that the graph is valid. 905 PhaseIdealLoop( PhaseIterGVN &igvn) : 906 PhaseTransform(Ideal_Loop), 907 _igvn(igvn), 908 _dom_lca_tags(arena()), // Thread::resource_area 909 _verify_me(NULL), 910 _verify_only(true) { 911 build_and_optimize(false, false); 912 } 913 914 // build the loop tree and perform any requested optimizations 915 void build_and_optimize(bool do_split_if, bool skip_loop_opts, bool last_round = false); 916 917 // Dominators for the sea of nodes 918 void Dominators(); 919 Node *dom_lca( Node *n1, Node *n2 ) const { 920 return find_non_split_ctrl(dom_lca_internal(n1, n2)); 921 } 922 Node *dom_lca_internal( Node *n1, Node *n2 ) const; 923 924 // Compute the Ideal Node to Loop mapping 925 PhaseIdealLoop( PhaseIterGVN &igvn, bool do_split_ifs, bool skip_loop_opts = false, bool last_round = false) : 926 PhaseTransform(Ideal_Loop), 927 _igvn(igvn), 928 _dom_lca_tags(arena()), // Thread::resource_area 929 _verify_me(NULL), 930 _verify_only(false) { 931 build_and_optimize(do_split_ifs, skip_loop_opts, last_round); 932 } 933 934 // Verify that verify_me made the same decisions as a fresh run. 935 PhaseIdealLoop( PhaseIterGVN &igvn, const PhaseIdealLoop *verify_me) : 936 PhaseTransform(Ideal_Loop), 937 _igvn(igvn), 938 _dom_lca_tags(arena()), // Thread::resource_area 939 _verify_me(verify_me), 940 _verify_only(false) { 941 build_and_optimize(false, false); 942 } 943 944 // Build and verify the loop tree without modifying the graph. This 945 // is useful to verify that all inputs properly dominate their uses. 946 static void verify(PhaseIterGVN& igvn) { 947 #ifdef ASSERT 948 PhaseIdealLoop v(igvn); 949 #endif 950 } 951 1210 Node *clone_iff( PhiNode *phi, IdealLoopTree *loop ); 1211 CmpNode *clone_bool( PhiNode *phi, IdealLoopTree *loop ); 1212 1213 1214 // Rework addressing expressions to get the most loop-invariant stuff 1215 // moved out. We'd like to do all associative operators, but it's especially 1216 // important (common) to do address expressions. 1217 Node *remix_address_expressions( Node *n ); 1218 1219 // Attempt to use a conditional move instead of a phi/branch 1220 Node *conditional_move( Node *n ); 1221 1222 // Reorganize offset computations to lower register pressure. 1223 // Mostly prevent loop-fallout uses of the pre-incremented trip counter 1224 // (which are then alive with the post-incremented trip counter 1225 // forcing an extra register move) 1226 void reorg_offsets( IdealLoopTree *loop ); 1227 1228 // Check for aggressive application of 'split-if' optimization, 1229 // using basic block level info. 1230 void split_if_with_blocks ( VectorSet &visited, Node_Stack &nstack, bool last_round ); 1231 Node *split_if_with_blocks_pre ( Node *n ); 1232 void split_if_with_blocks_post( Node *n, bool last_round ); 1233 Node *has_local_phi_input( Node *n ); 1234 // Mark an IfNode as being dominated by a prior test, 1235 // without actually altering the CFG (and hence IDOM info). 1236 void dominated_by( Node *prevdom, Node *iff, bool flip = false, bool exclude_loop_predicate = false ); 1237 1238 // Split Node 'n' through merge point 1239 Node *split_thru_region( Node *n, Node *region ); 1240 // Split Node 'n' through merge point if there is enough win. 1241 Node *split_thru_phi( Node *n, Node *region, int policy ); 1242 // Found an If getting its condition-code input from a Phi in the 1243 // same block. Split thru the Region. 1244 void do_split_if( Node *iff ); 1245 1246 // Conversion of fill/copy patterns into intrisic versions 1247 bool do_intrinsify_fill(); 1248 bool intrinsify_fill(IdealLoopTree* lpt); 1249 bool match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& store_value, 1250 Node*& shift, Node*& offset); 1251 1252 private: |