summaryrefslogtreecommitdiff
path: root/gcc/tree-loop-linear.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-15 16:13:33 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-15 16:13:33 +0000
commit2e54c85da51bec4d019f0d04f391314939247df7 (patch)
tree2a696ea15c824e9308e4456e69b42c210b4e281b /gcc/tree-loop-linear.c
parentbc55e08243291d5cd3f306ae2e452fec00eb722a (diff)
downloadgcc-2e54c85da51bec4d019f0d04f391314939247df7.tar.gz
2008-10-15 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/37686 * testsuite/gcc.dg/tree-ssa/pr37686.c: New. * tree-loop-linear.c (linear_transform_loops): Build a loop nest vector. Pass it to lambda_compute_access_matrices. * tree-data-ref.h (struct access_matrix): Store the loop nest relative to which it encodes the information. (AM_LOOP_NEST_NUM): Renamed AM_LOOP_NEST. (am_vector_index_for_loop): Reimplemented: iterate over the loop nest for finding the loop index in the access matrix. (lambda_compute_access_matrices): Update declaration. * lambda-code.c (build_access_matrix): Pass the loop nest and record it. (lambda_compute_access_matrices): Same. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141141 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-loop-linear.c')
-rw-r--r--gcc/tree-loop-linear.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
index a97433bf909..8b57e2acf10 100644
--- a/gcc/tree-loop-linear.c
+++ b/gcc/tree-loop-linear.c
@@ -333,11 +333,16 @@ linear_transform_loops (void)
lambda_loopnest before, after;
lambda_trans_matrix trans;
struct obstack lambda_obstack;
+ struct loop *loop;
+ VEC(loop_p,heap) *nest = VEC_alloc (loop_p, heap, 3);
depth = perfect_loop_nest_depth (loop_nest);
if (depth == 0)
continue;
+ for (loop = loop_nest; loop; loop = loop->inner)
+ VEC_safe_push (loop_p, heap, nest, loop);
+
gcc_obstack_init (&lambda_obstack);
VEC_truncate (tree, oldivs, 0);
VEC_truncate (tree, invariants, 0);
@@ -350,8 +355,7 @@ linear_transform_loops (void)
goto free_and_continue;
lambda_collect_parameters (datarefs, &lambda_parameters);
- if (!lambda_compute_access_matrices (datarefs, lambda_parameters,
- loop_nest->num))
+ if (!lambda_compute_access_matrices (datarefs, lambda_parameters, nest))
goto free_and_continue;
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -410,6 +414,7 @@ linear_transform_loops (void)
obstack_free (&lambda_obstack, NULL);
free_dependence_relations (dependence_relations);
free_data_refs (datarefs);
+ VEC_free (loop_p, heap, nest);
}
for (i = 0; VEC_iterate (gimple, remove_ivs, i, oldiv_stmt); i++)