Commit 36174c82 by Sebastian Pop Committed by Sebastian Pop

re PR tree-optimization/37686 (Building of CPU2000's bzip2 with peak flags with…

re PR tree-optimization/37686 (Building of CPU2000's bzip2 with peak flags with -mcpu=power4 fails with an ICE.)

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.

From-SVN: r141141
parent fb068247
2008-10-15 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/37686
* 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.
2008-10-15 Andreas Krebbel <krebbel1@de.ibm.com> 2008-10-15 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.h: (TARGET_DFP): This requires TARGET_HARD_FLOAT. * config/s390/s390.h: (TARGET_DFP): This requires TARGET_HARD_FLOAT.
......
...@@ -2786,17 +2786,15 @@ av_for_af (tree access_fun, lambda_vector cy, struct access_matrix *am) ...@@ -2786,17 +2786,15 @@ av_for_af (tree access_fun, lambda_vector cy, struct access_matrix *am)
static bool static bool
build_access_matrix (data_reference_p data_reference, build_access_matrix (data_reference_p data_reference,
VEC (tree, heap) *parameters, int loop_nest_num) VEC (tree, heap) *parameters, VEC (loop_p, heap) *nest)
{ {
struct access_matrix *am = GGC_NEW (struct access_matrix); struct access_matrix *am = GGC_NEW (struct access_matrix);
unsigned i, ndim = DR_NUM_DIMENSIONS (data_reference); unsigned i, ndim = DR_NUM_DIMENSIONS (data_reference);
struct loop *loop = gimple_bb (DR_STMT (data_reference))->loop_father; unsigned nivs = VEC_length (loop_p, nest);
struct loop *loop_nest = get_loop (loop_nest_num);
unsigned nivs = loop_depth (loop) - loop_depth (loop_nest) + 1;
unsigned lambda_nb_columns; unsigned lambda_nb_columns;
lambda_vector_vec_p matrix; lambda_vector_vec_p matrix;
AM_LOOP_NEST_NUM (am) = loop_nest_num; 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;
...@@ -2824,13 +2822,13 @@ build_access_matrix (data_reference_p data_reference, ...@@ -2824,13 +2822,13 @@ build_access_matrix (data_reference_p data_reference,
bool bool
lambda_compute_access_matrices (VEC (data_reference_p, heap) *datarefs, lambda_compute_access_matrices (VEC (data_reference_p, heap) *datarefs,
VEC (tree, heap) *parameters, VEC (tree, heap) *parameters,
int loop_nest_num) VEC (loop_p, heap) *nest)
{ {
data_reference_p dataref; data_reference_p dataref;
unsigned ix; unsigned ix;
for (ix = 0; VEC_iterate (data_reference_p, datarefs, ix, dataref); ix++) for (ix = 0; VEC_iterate (data_reference_p, datarefs, ix, dataref); ix++)
if (!build_access_matrix (dataref, parameters, loop_nest_num)) if (!build_access_matrix (dataref, parameters, nest))
return false; return false;
return true; return true;
......
2008-10-15 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/37686
* testsuite/gcc.dg/tree-ssa/pr37686.c: New.
2008-10-15 Jakub Jelinek <jakub@redhat.com> 2008-10-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/36881 PR tree-optimization/36881
......
/* { dg-do compile { target powerpc*-*-* } } */
/* { dg-options "-O3 -ftree-loop-linear" } */
unsigned char inUse[256];
unsigned char len[6][258];
int code[6][258];
unsigned int crc32Table[256] = { };
unsigned int getGlobalCRC (void) { }
int bsLive;
void bsW (int n, unsigned int v) {
while (bsLive >= 8) {}
}
void hbAssignCodes (int * code, unsigned char * length, int minLen,
int maxLen, int alphaSize) {
int n, vec, i;
for (n = minLen;n <= maxLen;n++)
for (i = 0; i < alphaSize;i++)
code[i] = vec;
}
void sendMTFValues (void) {
int v, t, i, j, gs, ge, totc, bt, bc, iter;
int nSelectors, alphaSize, minLen, maxLen, selCtr;
int nGroups, nBytes;
{
while (1)
{
break;
}
hbAssignCodes (&code[t][0], &len[t][0], minLen, maxLen, alphaSize);
unsigned char inUse16[16];
for (i = 0;i < 16;i++)
if (inUse16[i])
{
for (j = 0;j < 16;j++)
if (inUse[i * 16 + j]) { }
}
}
for (i = 0; i < nSelectors;i++) { }
for (t = 0; t < nGroups;t++)
{
int curr = len[t][0];
for (i = 0; i < alphaSize;i++)
while (curr < len[t][i]) { }
}
while (1)
for (i = gs; i <= ge;i++) { }
}
...@@ -128,13 +128,13 @@ typedef struct scop *scop_p; ...@@ -128,13 +128,13 @@ typedef struct scop *scop_p;
*/ */
struct access_matrix struct access_matrix
{ {
int loop_nest_num; 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, heap) *matrix;
}; };
#define AM_LOOP_NEST_NUM(M) (M)->loop_nest_num #define AM_LOOP_NEST(M) (M)->loop_nest
#define AM_NB_INDUCTION_VARS(M) (M)->nb_induction_vars #define AM_NB_INDUCTION_VARS(M) (M)->nb_induction_vars
#define AM_PARAMETERS(M) (M)->parameters #define AM_PARAMETERS(M) (M)->parameters
#define AM_MATRIX(M) (M)->matrix #define AM_MATRIX(M) (M)->matrix
...@@ -149,8 +149,14 @@ struct access_matrix ...@@ -149,8 +149,14 @@ struct access_matrix
static inline int static inline int
am_vector_index_for_loop (struct access_matrix *access_matrix, int loop_num) am_vector_index_for_loop (struct access_matrix *access_matrix, int loop_num)
{ {
gcc_assert (loop_num >= AM_LOOP_NEST_NUM (access_matrix)); int i;
return loop_num - AM_LOOP_NEST_NUM (access_matrix); loop_p l;
for (i = 0; VEC_iterate (loop_p, AM_LOOP_NEST (access_matrix), i, l); i++)
if (l->num == loop_num)
return i;
gcc_unreachable();
} }
int access_matrix_get_index_for_parameter (tree, struct access_matrix *); int access_matrix_get_index_for_parameter (tree, struct access_matrix *);
...@@ -581,7 +587,7 @@ bool lambda_transform_legal_p (lambda_trans_matrix, int, ...@@ -581,7 +587,7 @@ bool lambda_transform_legal_p (lambda_trans_matrix, int,
void lambda_collect_parameters (VEC (data_reference_p, heap) *, void lambda_collect_parameters (VEC (data_reference_p, heap) *,
VEC (tree, heap) **); VEC (tree, heap) **);
bool lambda_compute_access_matrices (VEC (data_reference_p, heap) *, bool lambda_compute_access_matrices (VEC (data_reference_p, heap) *,
VEC (tree, heap) *, int); VEC (tree, heap) *, VEC (loop_p, heap) *);
/* In tree-data-ref.c */ /* In tree-data-ref.c */
void split_constant_offset (tree , tree *, tree *); void split_constant_offset (tree , tree *, tree *);
......
...@@ -333,11 +333,16 @@ linear_transform_loops (void) ...@@ -333,11 +333,16 @@ linear_transform_loops (void)
lambda_loopnest before, after; lambda_loopnest before, after;
lambda_trans_matrix trans; lambda_trans_matrix trans;
struct obstack lambda_obstack; 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); depth = perfect_loop_nest_depth (loop_nest);
if (depth == 0) if (depth == 0)
continue; continue;
for (loop = loop_nest; loop; loop = loop->inner)
VEC_safe_push (loop_p, heap, nest, loop);
gcc_obstack_init (&lambda_obstack); gcc_obstack_init (&lambda_obstack);
VEC_truncate (tree, oldivs, 0); VEC_truncate (tree, oldivs, 0);
VEC_truncate (tree, invariants, 0); VEC_truncate (tree, invariants, 0);
...@@ -350,8 +355,7 @@ linear_transform_loops (void) ...@@ -350,8 +355,7 @@ linear_transform_loops (void)
goto free_and_continue; goto free_and_continue;
lambda_collect_parameters (datarefs, &lambda_parameters); lambda_collect_parameters (datarefs, &lambda_parameters);
if (!lambda_compute_access_matrices (datarefs, lambda_parameters, if (!lambda_compute_access_matrices (datarefs, lambda_parameters, nest))
loop_nest->num))
goto free_and_continue; goto free_and_continue;
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
...@@ -410,6 +414,7 @@ linear_transform_loops (void) ...@@ -410,6 +414,7 @@ linear_transform_loops (void)
obstack_free (&lambda_obstack, NULL); obstack_free (&lambda_obstack, NULL);
free_dependence_relations (dependence_relations); free_dependence_relations (dependence_relations);
free_data_refs (datarefs); free_data_refs (datarefs);
VEC_free (loop_p, heap, nest);
} }
for (i = 0; VEC_iterate (gimple, remove_ivs, i, oldiv_stmt); i++) for (i = 0; VEC_iterate (gimple, remove_ivs, i, oldiv_stmt); i++)
......
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