Commit 45222d4a by Thomas Neumann Committed by Thomas Neumann

lambda-code.c (struct lambda_lattice_s): Add a name to the struct.

	* lambda-code.c (struct lambda_lattice_s): Add a name to the struct.
	(lambda_body_vector_new): Use type safe memory macros.
	(lambda_linear_expression_new): Likewise.
	(lambda_loopnest_new): Likewise.
	(lambda_lattice_new): Likewise.
	(replace_uses_equiv_to_x_with_y): Cast according to the coding
	conventions. Use type safe memory macros.
	* lambda.h (struct lambda_trans_matrix_s): Add a name to the struct.
	(lambda_body_vector_s): Likewise.
	* lambda-mat.c (lambda_matrix_new): Use type safe memory macros.
	* lambda-trans.c (lambda_trans_matrix_new): Likewise.

From-SVN: r125491
parent 68c834d0
2007-06-06 Thomas Neumann <tneumann@users.sourceforge.net>
* lambda-code.c (struct lambda_lattice_s): Add a name to the struct.
(lambda_body_vector_new): Use type safe memory macros.
(lambda_linear_expression_new): Likewise.
(lambda_loopnest_new): Likewise.
(lambda_lattice_new): Likewise.
(replace_uses_equiv_to_x_with_y): Cast according to the coding
conventions. Use type safe memory macros.
* lambda.h (struct lambda_trans_matrix_s): Add a name to the struct.
(lambda_body_vector_s): Likewise.
* lambda-mat.c (lambda_matrix_new): Use type safe memory macros.
* lambda-trans.c (lambda_trans_matrix_new): Likewise.
2007-06-06 Richard Guenther <rguenther@suse.de> 2007-06-06 Richard Guenther <rguenther@suse.de>
* tree-ssa-forwprop.c (forward_propagate_into_cond): Return 2 * tree-ssa-forwprop.c (forward_propagate_into_cond): Return 2
......
...@@ -120,7 +120,7 @@ static bool perfect_nestify (struct loop *, VEC(tree,heap) *, ...@@ -120,7 +120,7 @@ static bool perfect_nestify (struct loop *, VEC(tree,heap) *,
VEC(tree,heap) *); VEC(tree,heap) *);
/* Lattice stuff that is internal to the code generation algorithm. */ /* Lattice stuff that is internal to the code generation algorithm. */
typedef struct typedef struct lambda_lattice_s
{ {
/* Lattice base matrix. */ /* Lattice base matrix. */
lambda_matrix base; lambda_matrix base;
...@@ -155,7 +155,7 @@ lambda_body_vector_new (int size) ...@@ -155,7 +155,7 @@ lambda_body_vector_new (int size)
{ {
lambda_body_vector ret; lambda_body_vector ret;
ret = ggc_alloc (sizeof (*ret)); ret = GGC_NEW (struct lambda_body_vector_s);
LBV_COEFFICIENTS (ret) = lambda_vector_new (size); LBV_COEFFICIENTS (ret) = lambda_vector_new (size);
LBV_SIZE (ret) = size; LBV_SIZE (ret) = size;
LBV_DENOMINATOR (ret) = 1; LBV_DENOMINATOR (ret) = 1;
...@@ -227,7 +227,7 @@ lambda_linear_expression_new (int dim, int invariants) ...@@ -227,7 +227,7 @@ lambda_linear_expression_new (int dim, int invariants)
{ {
lambda_linear_expression ret; lambda_linear_expression ret;
ret = ggc_alloc_cleared (sizeof (*ret)); ret = GGC_CNEW (struct lambda_linear_expression_s);
LLE_COEFFICIENTS (ret) = lambda_vector_new (dim); LLE_COEFFICIENTS (ret) = lambda_vector_new (dim);
LLE_CONSTANT (ret) = 0; LLE_CONSTANT (ret) = 0;
...@@ -328,9 +328,9 @@ lambda_loopnest ...@@ -328,9 +328,9 @@ lambda_loopnest
lambda_loopnest_new (int depth, int invariants) lambda_loopnest_new (int depth, int invariants)
{ {
lambda_loopnest ret; lambda_loopnest ret;
ret = ggc_alloc (sizeof (*ret)); ret = GGC_NEW (struct lambda_loopnest_s);
LN_LOOPS (ret) = ggc_alloc_cleared (depth * sizeof (lambda_loop)); LN_LOOPS (ret) = GGC_CNEWVEC (lambda_loop, depth);
LN_DEPTH (ret) = depth; LN_DEPTH (ret) = depth;
LN_INVARIANTS (ret) = invariants; LN_INVARIANTS (ret) = invariants;
...@@ -360,7 +360,7 @@ static lambda_lattice ...@@ -360,7 +360,7 @@ static lambda_lattice
lambda_lattice_new (int depth, int invariants) lambda_lattice_new (int depth, int invariants)
{ {
lambda_lattice ret; lambda_lattice ret;
ret = ggc_alloc (sizeof (*ret)); ret = GGC_NEW (struct lambda_lattice_s);
LATTICE_BASE (ret) = lambda_matrix_new (depth, depth); LATTICE_BASE (ret) = lambda_matrix_new (depth, depth);
LATTICE_ORIGIN (ret) = lambda_vector_new (depth); LATTICE_ORIGIN (ret) = lambda_vector_new (depth);
LATTICE_ORIGIN_INVARIANTS (ret) = lambda_matrix_new (depth, invariants); LATTICE_ORIGIN_INVARIANTS (ret) = lambda_matrix_new (depth, invariants);
...@@ -1981,7 +1981,7 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x, ...@@ -1981,7 +1981,7 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x,
temporaries. */ temporaries. */
in.hash = htab_hash_pointer (use); in.hash = htab_hash_pointer (use);
in.base.from = use; in.base.from = use;
h = htab_find_with_hash (replacements, &in, in.hash); h = (struct tree_map *) htab_find_with_hash (replacements, &in, in.hash);
if (h != NULL) if (h != NULL)
{ {
SET_USE (use_p, h->to); SET_USE (use_p, h->to);
...@@ -2023,7 +2023,7 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x, ...@@ -2023,7 +2023,7 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x,
bsi_insert_before (firstbsi, setstmt, BSI_SAME_STMT); bsi_insert_before (firstbsi, setstmt, BSI_SAME_STMT);
update_stmt (setstmt); update_stmt (setstmt);
SET_USE (use_p, var); SET_USE (use_p, var);
h = ggc_alloc (sizeof (struct tree_map)); h = GGC_NEW (struct tree_map);
h->hash = in.hash; h->hash = in.hash;
h->base.from = use; h->base.from = use;
h->to = var; h->to = var;
......
...@@ -37,7 +37,7 @@ lambda_matrix_new (int m, int n) ...@@ -37,7 +37,7 @@ lambda_matrix_new (int m, int n)
lambda_matrix mat; lambda_matrix mat;
int i; int i;
mat = ggc_alloc (m * sizeof (lambda_vector)); mat = GGC_NEWVEC (lambda_vector, m);
for (i = 0; i < m; i++) for (i = 0; i < m; i++)
mat[i] = lambda_vector_new (n); mat[i] = lambda_vector_new (n);
......
...@@ -35,7 +35,7 @@ lambda_trans_matrix_new (int colsize, int rowsize) ...@@ -35,7 +35,7 @@ lambda_trans_matrix_new (int colsize, int rowsize)
{ {
lambda_trans_matrix ret; lambda_trans_matrix ret;
ret = ggc_alloc (sizeof (*ret)); ret = GGC_NEW (struct lambda_trans_matrix_s);
LTM_MATRIX (ret) = lambda_matrix_new (rowsize, colsize); LTM_MATRIX (ret) = lambda_matrix_new (rowsize, colsize);
LTM_ROWSIZE (ret) = rowsize; LTM_ROWSIZE (ret) = rowsize;
LTM_COLSIZE (ret) = colsize; LTM_COLSIZE (ret) = colsize;
......
...@@ -40,7 +40,7 @@ typedef lambda_vector *lambda_matrix; ...@@ -40,7 +40,7 @@ typedef lambda_vector *lambda_matrix;
/* A transformation matrix, which is a self-contained ROWSIZE x COLSIZE /* A transformation matrix, which is a self-contained ROWSIZE x COLSIZE
matrix. Rather than use floats, we simply keep a single DENOMINATOR that matrix. Rather than use floats, we simply keep a single DENOMINATOR that
represents the denominator for every element in the matrix. */ represents the denominator for every element in the matrix. */
typedef struct typedef struct lambda_trans_matrix_s
{ {
lambda_matrix matrix; lambda_matrix matrix;
int rowsize; int rowsize;
...@@ -61,7 +61,7 @@ typedef struct ...@@ -61,7 +61,7 @@ typedef struct
This structure is used during code generation in order to rewrite the old This structure is used during code generation in order to rewrite the old
induction variable uses in a statement in terms of the newly created induction variable uses in a statement in terms of the newly created
induction variables. */ induction variables. */
typedef struct typedef struct lambda_body_vector_s
{ {
lambda_vector coefficients; lambda_vector coefficients;
int size; int size;
...@@ -127,7 +127,7 @@ typedef struct lambda_loop_s ...@@ -127,7 +127,7 @@ typedef struct lambda_loop_s
and an integer representing the number of INVARIANTS in the loop. Both of and an integer representing the number of INVARIANTS in the loop. Both of
these integers are used to size the associated coefficient vectors in the these integers are used to size the associated coefficient vectors in the
linear expression structures. */ linear expression structures. */
typedef struct typedef struct lambda_loopnest_s
{ {
lambda_loop *loops; lambda_loop *loops;
int depth; int depth;
......
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