diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-01 18:08:02 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-01 18:08:02 +0000 |
commit | 557ef5d8cb6ffccf08f53b975c804a9384fc5493 (patch) | |
tree | 13c080b6513fecb915f215d79235d8f610719b6a /gcc/tree-loop-linear.c | |
parent | 7f726eff24ed1dd40b104ca01302b8537493515c (diff) | |
download | gcc-557ef5d8cb6ffccf08f53b975c804a9384fc5493.tar.gz |
2004-10-16 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/17672
Fix PR tree-optimization/18168
* lambda-code.c (lambda_lattice_compute_base): Fix reversed
assert test.
(gcc_tree_to_linear_expression): Add extra to existing constant.
(depth_of_nest): Factor out function used in various places.
(gcc_loop_to_lambda_loop): Clean up code a little bit. No
functional changes.
(find_induction_var_from_exit_cond): Stop guessing, and just
get the right answer :).
(gcc_loopnest_to_lambda_loopnest): Remove useless pre-allocation.
Print out message about result of attempt to create perfect nest.
(lbv_to_gcc_expression): Add type argument, use it to do math
and induction variable creation.
(lle_to_gcc_expression): Ditto.
(lambda_loopnest_to_gcc_loopnest): Create new iv with same type as
oldiv. Pass type argument to lle_to_gcc_expression and
lbv_to_gcc_expression.
Reset number of iterations after transformation.
(perfect_nestify): Remove useless pre-allocation, and cleanup
a small amount.
* tree-data-ref.c (build_classic_dist_vector): Return false for
dependences completely outside of the loop nest we asked about.
(build_classic_dir_vector): Ditto.
(compute_data_dependences_for_loop): Only add dependence relations
inside the loop we asked about.
* tree-loop-linear.c (linear_transform_loops): Use DDR_SIZE_VECT.
Compute immediate uses.
* tree-optimize.c: Move linear_transform_loops to before ivcanon.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@89945 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-loop-linear.c')
-rw-r--r-- | gcc/tree-loop-linear.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c index de16a1ecf92..07afe5dabb0 100644 --- a/gcc/tree-loop-linear.c +++ b/gcc/tree-loop-linear.c @@ -127,7 +127,6 @@ gather_interchange_stats (varray_type dependence_relations, (*dependence_steps) += 0; continue; } - dist = DDR_DIST_VECT (ddr)[loop_number]; if (dist == 0) (*nb_deps_not_carried_by_loop) += 1; @@ -240,6 +239,7 @@ linear_transform_loops (struct loops *loops) { unsigned int i; + compute_immediate_uses (TDFA_USE_OPS | TDFA_USE_VOPS, NULL); for (i = 1; i < loops->num; i++) { unsigned int depth = 0; @@ -247,8 +247,8 @@ linear_transform_loops (struct loops *loops) varray_type dependence_relations; struct loop *loop_nest = loops->parray[i]; struct loop *temp; - VEC (tree) *oldivs; - VEC (tree) *invariants; + VEC (tree) *oldivs = NULL; + VEC (tree) *invariants = NULL; lambda_loopnest before, after; lambda_trans_matrix trans; bool problem = false; @@ -306,11 +306,11 @@ linear_transform_loops (struct loops *loops) { fprintf (dump_file, "DISTANCE_V ("); print_lambda_vector (dump_file, DDR_DIST_VECT (ddr), - loops->num); + DDR_SIZE_VECT (ddr)); fprintf (dump_file, ")\n"); fprintf (dump_file, "DIRECTION_V ("); print_lambda_vector (dump_file, DDR_DIR_VECT (ddr), - loops->num); + DDR_SIZE_VECT (ddr)); fprintf (dump_file, ")\n"); } } @@ -319,6 +319,7 @@ linear_transform_loops (struct loops *loops) /* Build the transformation matrix. */ trans = lambda_trans_matrix_new (depth, depth); lambda_matrix_id (LTM_MATRIX (trans), depth); + trans = try_interchange_loops (trans, depth, dependence_relations, datarefs, loop_nest->num); @@ -359,11 +360,17 @@ linear_transform_loops (struct loops *loops) } lambda_loopnest_to_gcc_loopnest (loop_nest, oldivs, invariants, after, trans); + if (dump_file) + fprintf (dump_file, "Successfully transformed loop.\n"); oldivs = NULL; invariants = NULL; free_dependence_relations (dependence_relations); free_data_refs (datarefs); } - rewrite_into_loop_closed_ssa (); free_df (); + scev_reset (); + rewrite_into_loop_closed_ssa (); +#ifdef ENABLE_CHECKING + verify_loop_closed_ssa (); +#endif } |