Commit 96867bbd by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/37031 (ICE for h264ref in gather_interchange_stats with -ftree-loop-linear)

	PR tree-optimization/37031
	* lambda-code.c (lambda_collect_parameters): Call pointer_set_destroy
	on parameter_set.
	(build_access_matrix): Reserve correct size for AM_MATRIX vector,
	allocate it using gc instead of heap, use VEC_quick_push instead of
	VEC_safe_push.
	* graphite.c (build_access_matrix): Allocate AM_MATRIX vector using gc
	instead of heap, use VEC_quick_push instead of VEC_safe_push.
	* tree-data-ref.h (struct access_matrix): Change matrix to gc
	allocated vector from heap allocated.
	* lambda.h: Add DEF_VEC_ALLOC_P for gc allocated lambda_vector.
	* tree-loop-linear.c (linear_transform_loops): Allocate nest
	vector only after perfect_loop_nest_depth call.

From-SVN: r143188
parent 68f61c3d
2009-01-08 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/37031
* lambda-code.c (lambda_collect_parameters): Call pointer_set_destroy
on parameter_set.
(build_access_matrix): Reserve correct size for AM_MATRIX vector,
allocate it using gc instead of heap, use VEC_quick_push instead of
VEC_safe_push.
* graphite.c (build_access_matrix): Allocate AM_MATRIX vector using gc
instead of heap, use VEC_quick_push instead of VEC_safe_push.
* tree-data-ref.h (struct access_matrix): Change matrix to gc
allocated vector from heap allocated.
* lambda.h: Add DEF_VEC_ALLOC_P for gc allocated lambda_vector.
* tree-loop-linear.c (linear_transform_loops): Allocate nest
vector only after perfect_loop_nest_depth call.
2009-01-08 Sebastian Pop <sebastian.pop@amd.com> 2009-01-08 Sebastian Pop <sebastian.pop@amd.com>
Jan Sjodin <jan.sjodin@amd.com> Jan Sjodin <jan.sjodin@amd.com>
......
/* Gimple Represented as Polyhedra. /* Gimple Represented as Polyhedra.
Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc. Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Sebastian Pop <sebastian.pop@inria.fr>. Contributed by Sebastian Pop <sebastian.pop@inria.fr>.
This file is part of GCC. This file is part of GCC.
...@@ -3630,7 +3630,7 @@ build_access_matrix (data_reference_p ref, graphite_bb_p gb) ...@@ -3630,7 +3630,7 @@ build_access_matrix (data_reference_p ref, graphite_bb_p gb)
int i, ndim = DR_NUM_DIMENSIONS (ref); int i, ndim = DR_NUM_DIMENSIONS (ref);
struct access_matrix *am = GGC_NEW (struct access_matrix); struct access_matrix *am = GGC_NEW (struct access_matrix);
AM_MATRIX (am) = VEC_alloc (lambda_vector, heap, ndim); AM_MATRIX (am) = VEC_alloc (lambda_vector, gc, ndim);
DR_SCOP (ref) = GBB_SCOP (gb); DR_SCOP (ref) = GBB_SCOP (gb);
for (i = 0; i < ndim; i++) for (i = 0; i < ndim; i++)
...@@ -3642,7 +3642,7 @@ build_access_matrix (data_reference_p ref, graphite_bb_p gb) ...@@ -3642,7 +3642,7 @@ build_access_matrix (data_reference_p ref, graphite_bb_p gb)
if (!build_access_matrix_with_af (af, v, scop, ref_nb_loops (ref))) if (!build_access_matrix_with_af (af, v, scop, ref_nb_loops (ref)))
return false; return false;
VEC_safe_push (lambda_vector, heap, AM_MATRIX (am), v); VEC_quick_push (lambda_vector, AM_MATRIX (am), v);
} }
DR_ACCESS_MATRIX (ref) = am; DR_ACCESS_MATRIX (ref) = am;
......
/* Loop transformation code generation /* Loop transformation code generation
Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org> Contributed by Daniel Berlin <dberlin@dberlin.org>
This file is part of GCC. This file is part of GCC.
...@@ -2682,6 +2683,7 @@ lambda_collect_parameters (VEC (data_reference_p, heap) *datarefs, ...@@ -2682,6 +2683,7 @@ lambda_collect_parameters (VEC (data_reference_p, heap) *datarefs,
for (j = 0; j < DR_NUM_DIMENSIONS (data_reference); j++) for (j = 0; j < DR_NUM_DIMENSIONS (data_reference); j++)
lambda_collect_parameters_from_af (DR_ACCESS_FN (data_reference, j), lambda_collect_parameters_from_af (DR_ACCESS_FN (data_reference, j),
parameter_set, parameters); parameter_set, parameters);
pointer_set_destroy (parameter_set);
} }
/* Translates BASE_EXPR to vector CY. AM is needed for inferring /* Translates BASE_EXPR to vector CY. AM is needed for inferring
...@@ -2792,15 +2794,13 @@ build_access_matrix (data_reference_p data_reference, ...@@ -2792,15 +2794,13 @@ build_access_matrix (data_reference_p data_reference,
unsigned i, ndim = DR_NUM_DIMENSIONS (data_reference); unsigned i, ndim = DR_NUM_DIMENSIONS (data_reference);
unsigned nivs = VEC_length (loop_p, nest); unsigned nivs = VEC_length (loop_p, nest);
unsigned lambda_nb_columns; unsigned lambda_nb_columns;
lambda_vector_vec_p matrix;
AM_LOOP_NEST (am) = nest; AM_LOOP_NEST (am) = nest;
AM_NB_INDUCTION_VARS (am) = nivs; AM_NB_INDUCTION_VARS (am) = nivs;
AM_PARAMETERS (am) = parameters; AM_PARAMETERS (am) = parameters;
lambda_nb_columns = AM_NB_COLUMNS (am); lambda_nb_columns = AM_NB_COLUMNS (am);
matrix = VEC_alloc (lambda_vector, heap, lambda_nb_columns); AM_MATRIX (am) = VEC_alloc (lambda_vector, gc, ndim);
AM_MATRIX (am) = matrix;
for (i = 0; i < ndim; i++) for (i = 0; i < ndim; i++)
{ {
...@@ -2810,7 +2810,7 @@ build_access_matrix (data_reference_p data_reference, ...@@ -2810,7 +2810,7 @@ build_access_matrix (data_reference_p data_reference,
if (!av_for_af (access_function, access_vector, am)) if (!av_for_af (access_function, access_vector, am))
return false; return false;
VEC_safe_push (lambda_vector, heap, matrix, access_vector); VEC_quick_push (lambda_vector, AM_MATRIX (am), access_vector);
} }
DR_ACCESS_MATRIX (data_reference) = am; DR_ACCESS_MATRIX (data_reference) = am;
......
/* Lambda matrix and vector interface. /* Lambda matrix and vector interface.
Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org> Contributed by Daniel Berlin <dberlin@dberlin.org>
This file is part of GCC. This file is part of GCC.
...@@ -30,6 +31,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -30,6 +31,7 @@ along with GCC; see the file COPYING3. If not see
typedef int *lambda_vector; typedef int *lambda_vector;
DEF_VEC_P(lambda_vector); DEF_VEC_P(lambda_vector);
DEF_VEC_ALLOC_P(lambda_vector,heap); DEF_VEC_ALLOC_P(lambda_vector,heap);
DEF_VEC_ALLOC_P(lambda_vector,gc);
typedef VEC(lambda_vector, heap) *lambda_vector_vec_p; typedef VEC(lambda_vector, heap) *lambda_vector_vec_p;
DEF_VEC_P (lambda_vector_vec_p); DEF_VEC_P (lambda_vector_vec_p);
......
/* Data references and dependences detectors. /* Data references and dependences detectors.
Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Sebastian Pop <pop@cri.ensmp.fr> Contributed by Sebastian Pop <pop@cri.ensmp.fr>
This file is part of GCC. This file is part of GCC.
...@@ -131,7 +132,7 @@ struct access_matrix ...@@ -131,7 +132,7 @@ struct access_matrix
VEC (loop_p, heap) *loop_nest; VEC (loop_p, heap) *loop_nest;
int nb_induction_vars; int nb_induction_vars;
VEC (tree, heap) *parameters; VEC (tree, heap) *parameters;
VEC (lambda_vector, heap) *matrix; VEC (lambda_vector, gc) *matrix;
}; };
#define AM_LOOP_NEST(M) (M)->loop_nest #define AM_LOOP_NEST(M) (M)->loop_nest
......
/* Linear Loop transforms /* Linear Loop transforms
Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009
Free Software Foundation, Inc.
Contributed by Daniel Berlin <dberlin@dberlin.org>. Contributed by Daniel Berlin <dberlin@dberlin.org>.
This file is part of GCC. This file is part of GCC.
...@@ -334,12 +335,13 @@ linear_transform_loops (void) ...@@ -334,12 +335,13 @@ linear_transform_loops (void)
lambda_trans_matrix trans; lambda_trans_matrix trans;
struct obstack lambda_obstack; struct obstack lambda_obstack;
struct loop *loop; struct loop *loop;
VEC(loop_p,heap) *nest = VEC_alloc (loop_p, heap, 3); VEC(loop_p,heap) *nest;
depth = perfect_loop_nest_depth (loop_nest); depth = perfect_loop_nest_depth (loop_nest);
if (depth == 0) if (depth == 0)
continue; continue;
nest = VEC_alloc (loop_p, heap, 3);
for (loop = loop_nest; loop; loop = loop->inner) for (loop = loop_nest; loop; loop = loop->inner)
VEC_safe_push (loop_p, heap, nest, loop); VEC_safe_push (loop_p, heap, nest, loop);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment