comparison gcc/lambda.h @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children b7f97abdc517
comparison
equal deleted inserted replaced
52:c156f1bd5cd9 55:77e2b8dfacca
76 } *lambda_body_vector; 76 } *lambda_body_vector;
77 #define LBV_COEFFICIENTS(T) ((T)->coefficients) 77 #define LBV_COEFFICIENTS(T) ((T)->coefficients)
78 #define LBV_SIZE(T) ((T)->size) 78 #define LBV_SIZE(T) ((T)->size)
79 #define LBV_DENOMINATOR(T) ((T)->denominator) 79 #define LBV_DENOMINATOR(T) ((T)->denominator)
80 80
81 /* Piecewise linear expression. 81 /* Piecewise linear expression.
82 This structure represents a linear expression with terms for the invariants 82 This structure represents a linear expression with terms for the invariants
83 and induction variables of a loop. 83 and induction variables of a loop.
84 COEFFICIENTS is a vector of coefficients for the induction variables, one 84 COEFFICIENTS is a vector of coefficients for the induction variables, one
85 per loop in the loop nest. 85 per loop in the loop nest.
86 CONSTANT is the constant portion of the linear expression 86 CONSTANT is the constant portion of the linear expression
87 INVARIANT_COEFFICIENTS is a vector of coefficients for the loop invariants, 87 INVARIANT_COEFFICIENTS is a vector of coefficients for the loop invariants,
88 one per invariant. 88 one per invariant.
89 DENOMINATOR is the denominator for all of the coefficients and constants in 89 DENOMINATOR is the denominator for all of the coefficients and constants in
90 the expression. 90 the expression.
91 The linear expressions can be linked together using the NEXT field, in 91 The linear expressions can be linked together using the NEXT field, in
92 order to represent MAX or MIN of a group of linear expressions. */ 92 order to represent MAX or MIN of a group of linear expressions. */
93 typedef struct lambda_linear_expression_s 93 typedef struct lambda_linear_expression_s
94 { 94 {
95 lambda_vector coefficients; 95 lambda_vector coefficients;
129 #define LL_LOWER_BOUND(T) ((T)->lower_bound) 129 #define LL_LOWER_BOUND(T) ((T)->lower_bound)
130 #define LL_UPPER_BOUND(T) ((T)->upper_bound) 130 #define LL_UPPER_BOUND(T) ((T)->upper_bound)
131 #define LL_LINEAR_OFFSET(T) ((T)->linear_offset) 131 #define LL_LINEAR_OFFSET(T) ((T)->linear_offset)
132 #define LL_STEP(T) ((T)->step) 132 #define LL_STEP(T) ((T)->step)
133 133
134 /* Loop nest structure. 134 /* Loop nest structure.
135 The loop nest structure consists of a set of loop structures (defined 135 The loop nest structure consists of a set of loop structures (defined
136 above) in LOOPS, along with an integer representing the DEPTH of the loop, 136 above) in LOOPS, along with an integer representing the DEPTH of the loop,
137 and an integer representing the number of INVARIANTS in the loop. Both of 137 and an integer representing the number of INVARIANTS in the loop. Both of
138 these integers are used to size the associated coefficient vectors in the 138 these integers are used to size the associated coefficient vectors in the
139 linear expression structures. */ 139 linear expression structures. */
185 int lambda_matrix_inverse (lambda_matrix, lambda_matrix, int); 185 int lambda_matrix_inverse (lambda_matrix, lambda_matrix, int);
186 void lambda_matrix_hermite (lambda_matrix, int, lambda_matrix, lambda_matrix); 186 void lambda_matrix_hermite (lambda_matrix, int, lambda_matrix, lambda_matrix);
187 void lambda_matrix_left_hermite (lambda_matrix, int, int, lambda_matrix, lambda_matrix); 187 void lambda_matrix_left_hermite (lambda_matrix, int, int, lambda_matrix, lambda_matrix);
188 void lambda_matrix_right_hermite (lambda_matrix, int, int, lambda_matrix, lambda_matrix); 188 void lambda_matrix_right_hermite (lambda_matrix, int, int, lambda_matrix, lambda_matrix);
189 int lambda_matrix_first_nz_vec (lambda_matrix, int, int, int); 189 int lambda_matrix_first_nz_vec (lambda_matrix, int, int, int);
190 void lambda_matrix_project_to_null (lambda_matrix, int, int, int, 190 void lambda_matrix_project_to_null (lambda_matrix, int, int, int,
191 lambda_vector); 191 lambda_vector);
192 void print_lambda_matrix (FILE *, lambda_matrix, int, int); 192 void print_lambda_matrix (FILE *, lambda_matrix, int, int);
193 193
194 lambda_trans_matrix lambda_trans_matrix_new (int, int); 194 lambda_trans_matrix lambda_trans_matrix_new (int, int);
195 bool lambda_trans_matrix_nonsingular_p (lambda_trans_matrix); 195 bool lambda_trans_matrix_nonsingular_p (lambda_trans_matrix);
197 int lambda_trans_matrix_rank (lambda_trans_matrix); 197 int lambda_trans_matrix_rank (lambda_trans_matrix);
198 lambda_trans_matrix lambda_trans_matrix_basis (lambda_trans_matrix); 198 lambda_trans_matrix lambda_trans_matrix_basis (lambda_trans_matrix);
199 lambda_trans_matrix lambda_trans_matrix_padding (lambda_trans_matrix); 199 lambda_trans_matrix lambda_trans_matrix_padding (lambda_trans_matrix);
200 lambda_trans_matrix lambda_trans_matrix_inverse (lambda_trans_matrix); 200 lambda_trans_matrix lambda_trans_matrix_inverse (lambda_trans_matrix);
201 void print_lambda_trans_matrix (FILE *, lambda_trans_matrix); 201 void print_lambda_trans_matrix (FILE *, lambda_trans_matrix);
202 void lambda_matrix_vector_mult (lambda_matrix, int, int, lambda_vector, 202 void lambda_matrix_vector_mult (lambda_matrix, int, int, lambda_vector,
203 lambda_vector); 203 lambda_vector);
204 bool lambda_trans_matrix_id_p (lambda_trans_matrix); 204 bool lambda_trans_matrix_id_p (lambda_trans_matrix);
205 205
206 lambda_body_vector lambda_body_vector_new (int, struct obstack *); 206 lambda_body_vector lambda_body_vector_new (int, struct obstack *);
207 lambda_body_vector lambda_body_vector_compute_new (lambda_trans_matrix, 207 lambda_body_vector lambda_body_vector_compute_new (lambda_trans_matrix,
260 vec2[i] = const1 * vec1[i]; 260 vec2[i] = const1 * vec1[i];
261 } 261 }
262 262
263 /* Negate vector VEC1 with length SIZE and store it in VEC2. */ 263 /* Negate vector VEC1 with length SIZE and store it in VEC2. */
264 264
265 static inline void 265 static inline void
266 lambda_vector_negate (lambda_vector vec1, lambda_vector vec2, 266 lambda_vector_negate (lambda_vector vec1, lambda_vector vec2,
267 int size) 267 int size)
268 { 268 {
269 lambda_vector_mult_const (vec1, vec2, size, -1); 269 lambda_vector_mult_const (vec1, vec2, size, -1);
270 } 270 }
301 memcpy (vec2, vec1, size * sizeof (*vec1)); 301 memcpy (vec2, vec1, size * sizeof (*vec1));
302 } 302 }
303 303
304 /* Return true if vector VEC1 of length SIZE is the zero vector. */ 304 /* Return true if vector VEC1 of length SIZE is the zero vector. */
305 305
306 static inline bool 306 static inline bool
307 lambda_vector_zerop (lambda_vector vec1, int size) 307 lambda_vector_zerop (lambda_vector vec1, int size)
308 { 308 {
309 int i; 309 int i;
310 for (i = 0; i < size; i++) 310 for (i = 0; i < size; i++)
311 if (vec1[i] != 0) 311 if (vec1[i] != 0)
320 { 320 {
321 memset (vec1, 0, size * sizeof (*vec1)); 321 memset (vec1, 0, size * sizeof (*vec1));
322 } 322 }
323 323
324 /* Return true if two vectors are equal. */ 324 /* Return true if two vectors are equal. */
325 325
326 static inline bool 326 static inline bool
327 lambda_vector_equal (lambda_vector vec1, lambda_vector vec2, int size) 327 lambda_vector_equal (lambda_vector vec1, lambda_vector vec2, int size)
328 { 328 {
329 int i; 329 int i;
330 for (i = 0; i < size; i++) 330 for (i = 0; i < size; i++)
368 368
369 369
370 /* Multiply a vector by a matrix. */ 370 /* Multiply a vector by a matrix. */
371 371
372 static inline void 372 static inline void
373 lambda_vector_matrix_mult (lambda_vector vect, int m, lambda_matrix mat, 373 lambda_vector_matrix_mult (lambda_vector vect, int m, lambda_matrix mat,
374 int n, lambda_vector dest) 374 int n, lambda_vector dest)
375 { 375 {
376 int i, j; 376 int i, j;
377 lambda_vector_clear (dest, n); 377 lambda_vector_clear (dest, n);
378 for (i = 0; i < n; i++) 378 for (i = 0; i < n; i++)
380 dest[i] += mat[j][i] * vect[j]; 380 dest[i] += mat[j][i] * vect[j];
381 } 381 }
382 382
383 /* Compare two vectors returning an integer less than, equal to, or 383 /* Compare two vectors returning an integer less than, equal to, or
384 greater than zero if the first argument is considered to be respectively 384 greater than zero if the first argument is considered to be respectively
385 less than, equal to, or greater than the second. 385 less than, equal to, or greater than the second.
386 We use the lexicographic order. */ 386 We use the lexicographic order. */
387 387
388 static inline int 388 static inline int
389 lambda_vector_compare (lambda_vector vec1, int length1, lambda_vector vec2, 389 lambda_vector_compare (lambda_vector vec1, int length1, lambda_vector vec2,
390 int length2) 390 int length2)
421 } 421 }
422 422
423 /* Compute the greatest common divisor of two numbers using 423 /* Compute the greatest common divisor of two numbers using
424 Euclid's algorithm. */ 424 Euclid's algorithm. */
425 425
426 static inline int 426 static inline int
427 gcd (int a, int b) 427 gcd (int a, int b)
428 { 428 {
429 int x, y, z; 429 int x, y, z;
430 430
431 x = abs (a); 431 x = abs (a);
460 460
461 /* Returns true when the vector V is lexicographically positive, in 461 /* Returns true when the vector V is lexicographically positive, in
462 other words, when the first nonzero element is positive. */ 462 other words, when the first nonzero element is positive. */
463 463
464 static inline bool 464 static inline bool
465 lambda_vector_lexico_pos (lambda_vector v, 465 lambda_vector_lexico_pos (lambda_vector v,
466 unsigned n) 466 unsigned n)
467 { 467 {
468 unsigned i; 468 unsigned i;
469 for (i = 0; i < n; i++) 469 for (i = 0; i < n; i++)
470 { 470 {