summaryrefslogtreecommitdiff
path: root/gcc/lambda.h
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-03 17:32:34 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-03 17:32:34 +0000
commit84420febd48a05b506f12b42e5e09a28ec79ca8c (patch)
tree8465e9dd44bb38c923701c2c41d78e75fb2c644d /gcc/lambda.h
parent730cfe050422d6f92fa10d01ce004c418ad2f19d (diff)
downloadgcc-84420febd48a05b506f12b42e5e09a28ec79ca8c.tar.gz
2004-11-02 Daniel Berlin <dberlin@dberlin.org>
* lambda-code.c (lambda_compute_auxillary_space): Update comments. (lambda_compute_target_space). Ditto. * lambda.h (lambda_trans_matrix): Ditto. (lambda_linear_expression): Ditto. (lambda_body_vector): Ditto. (lambda_loopnest): Ditto. * tree-loop-linear.c (gather_interchange_stats): Combine tests, update comments, and remove pointless addition of 0. (linear_transform_loops): Update comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90029 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lambda.h')
-rw-r--r--gcc/lambda.h42
1 files changed, 37 insertions, 5 deletions
diff --git a/gcc/lambda.h b/gcc/lambda.h
index b7360241acc..98fe6bd1ca6 100644
--- a/gcc/lambda.h
+++ b/gcc/lambda.h
@@ -29,11 +29,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
and scalar multiplication. In this vector space, an element is a list of
integers. */
typedef int *lambda_vector;
+
/* An integer matrix. A matrix consists of m vectors of length n (IE
all vectors are the same length). */
typedef lambda_vector *lambda_matrix;
-/* A transformation matrix. */
+/* A transformation matrix, which is a self-contained ROWSIZE x COLSIZE
+ matrix. Rather than use floats, we simply keep a single DENOMINATOR that
+ represents the denominator for every element in the matrix. */
typedef struct
{
lambda_matrix matrix;
@@ -46,7 +49,15 @@ typedef struct
#define LTM_COLSIZE(T) ((T)->colsize)
#define LTM_DENOMINATOR(T) ((T)->denominator)
-/* A vector representing a statement in the body of a loop. */
+/* A vector representing a statement in the body of a loop.
+ The COEFFICIENTS vector contains a coefficient for each induction variable
+ in the loop nest containing the statement.
+ The DENOMINATOR represents the denominator for each coefficient in the
+ COEFFICIENT vector.
+
+ 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 variables. */
typedef struct
{
lambda_vector coefficients;
@@ -57,7 +68,18 @@ typedef struct
#define LBV_SIZE(T) ((T)->size)
#define LBV_DENOMINATOR(T) ((T)->denominator)
-/* Piecewise linear expression. */
+/* Piecewise linear expression.
+ This structure represents a linear expression with terms for the invariants
+ and induction variables of a loop.
+ COEFFICIENTS is a vector of coefficients for the induction variables, one
+ per loop in the loop nest.
+ CONSTANT is the constant portion of the linear expression
+ INVARIANT_COEFFICIENTS is a vector of coefficients for the loop invariants,
+ one per invariant.
+ DENOMINATOR is the denominator for all of the coefficients and constants in
+ the expression.
+ The linear expressions can be linked together using the NEXT field, in
+ order to represent MAX or MIN of a group of linear expressions. */
typedef struct lambda_linear_expression_s
{
lambda_vector coefficients;
@@ -77,7 +99,12 @@ lambda_linear_expression lambda_linear_expression_new (int, int);
void print_lambda_linear_expression (FILE *, lambda_linear_expression, int,
int, char);
-/* Loop structure. */
+/* Loop structure. Our loop structure consists of a constant representing the
+ STEP of the loop, a set of linear expressions representing the LOWER_BOUND
+ of the loop, a set of linear expressions representing the UPPER_BOUND of
+ the loop, and a set of linear expressions representing the LINEAR_OFFSET of
+ the loop. The linear offset is a set of linear expressions that are
+ applied to *both* the lower bound, and the upper bound. */
typedef struct lambda_loop_s
{
lambda_linear_expression lower_bound;
@@ -91,7 +118,12 @@ typedef struct lambda_loop_s
#define LL_LINEAR_OFFSET(T) ((T)->linear_offset)
#define LL_STEP(T) ((T)->step)
-/* Loop nest structure. */
+/* Loop nest structure.
+ The loop nest structure consists of a set of loop structures (defined
+ above) in LOOPS, along with an integer representing the DEPTH of the loop,
+ 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
+ linear expression structures. */
typedef struct
{
lambda_loop *loops;