#include "defs.h"#include "errors.h"#include "mempool.h"


Go to the source code of this file.
| #define DEPV_Dep | ( | depv, | |||
| i | ) | depv[i] |
| #define DIRECTION_MASK_PRIVATE 0x7000 |
| #define DISTANCE_FLAG_PRIVATE 0x8000 |
Definition at line 222 of file dvector.h.
Referenced by DEP_IsDistance(), DEP_MAKE_DIST_CONST_PRIVATE(), and DEP_MAKE_DIST_NON_CONST_PRIVATE().
| #define DISTANCE_MASK_PRIVATE 0x0FFF |
Definition at line 223 of file dvector.h.
Referenced by DEP_Distance(), DEP_DistanceBound(), and DEP_SET_DIST_PRIVATE().
| #define DISTANCE_OFFSET_PRIVATE 2048 |
Definition at line 224 of file dvector.h.
Referenced by DEP_Distance(), DEP_DistanceBound(), and DEP_SET_DIST_PRIVATE().
| #define MAX_BOUND_PRIVATE 4095 |
| #define MAX_DISTANCE_PRIVATE 2047 |
| #define MIN_DISTANCE_PRIVATE -2048 |
| enum DIRECTION |
Dependence Vectors -------------------
Description:
This is the basic data structure used to represent loop dependences. A dependence vector, DEPV, is an array of dependences, one for each enclosing do loop. Each dependence, DEP, is a mixed distance direction: i.e. either a constant integer or a union of directions. DEP is implemented as a 16 bit quantity. The leftmost bit tells whether the dependence is a constant distance dependence. The next 3 bits give the direction. The rightmost 12 bits give the distance is this is a constant distance dependence and a bound on the distance otherwise.
Exported types and functions:
DIRECTION
An enumeration containing the following values {DIR_POS,DIR_NEG,DIR_EQ,DIR_POSNEG,DIR_POSEQ, DIR_NEGEQ,DIR_STAR}
void DIRECTION_Print(DIRECTION direction,FILE *fp)
Print a direction
DEP
A single direction/distance. The following functions/fields are defined for distances.
Is this dependence a constant distance?
INT32 DEP_Distance(DEP Dep)
The distance of the dependence. This is only defined for cases when IsDistance returns true. On overflow, this just sets the direction. Note that this is a function and cannot be a lhs.
UINT32 DEP_DistanceBound(DEP Dep)
This gives a bound on the distance. In other words, this gives a guarantee that abs(dist) >= bound On overflow, the bound is set to some edge value.
DIRECTION DEP_Direction(DEP Dep)
The direction of the dependence. This is defined even if the dependence has a distance.
DEP DEP_SetDistance(INT32 distance)
Return a dependence that has a distance of distance If distance doesn't fit into 16 bits, set the distance to be non-constant, but the bound to be max
DEP DEP_SetDirection(DIRECTION direction)
Return a dependence that has a DIRECTION direction. This automatically sets the dependence to NOT have a distance (unless the direction is = in which case the distance is 0).
DEP DEP_UnionDirection(DEP dep,DIRECTION direction)
Return a dependence that has a direction that is the union of dep's direction and direction. This automatically sets the dependence to NOT have a distance.
Negate a dependence
void DEP_Lex_Pos_Decompose(DEP dep,MEM_POOL *pool,DEP **pos, DEP **neg, BOOL keep_pos_equals,BOOL keep_neg_equals)
Compute the lexicographically positive decomposition of dep and of -dep. Set *pos to lexpos(this). Set *neg to lexpos(-this). If (0) is part of the original it will be placed in pos iff keep_pos_equals==TRUE, it will be place in neg iff keep_neg_equals==TRUE *pos,*neg will be set to NULL if there is no pos/neg dependence
DEP DEP_Lex_Pos_Compose(DEP *pos, DEP *neg, BOOL *pos_has_eq, BOOL *neg_has_eq)
Reverse the above process. Pos/Neg = NULL implies there are no pos/neg component (Although one must be non-NULL) Also set pos_has_eq/neg_has_eq to true iff the original positive/negative contained the equal direction.
void DEP_Print(const DEP dep,FILE *fp)
Print a dependence.
void DEP_PrintBound(const DEP dep,FILE *fp)
Print the bound of the dependence.
DEPV
A vector of dependences.
DEP DEPV_Dep(DEPV *depv, UINT8 i)
The i'th dimension (the first dimension is 0). Can be either a LHS or a RHS
DEPV *DEPV_Create(MEM_POOL *mem_pool,UINT8 num_dim)
Create a new, uninitialized dependence vector
DEPV *DEPV_CreateStar(MEM_POOL *mem_pool,UINT8 num_dim)
Create a new dependence vector with each term set to star
DEPV *DEPV_CreateEqual(MEM_POOL *mem_pool,UINT8 num_dim)
Create a new dependence vector with each term set to equal
DEPV *DEPV_Copy(MEM_POOL *mem_pool, DEPV *depv, UINT8 num_dim)
Create a new dependence vector equal to depv
DEPV *DEPV_Free(MEM_POOL *mem_pool,DEPV *depv)
Free the storage for the dependence vector
void DEPV_Print(const DEPV *depv,FILE *fp, UINT8 num_dim)
Print a dependence vector.
void DEPV_PrintBound(const DEPV *depv,FILE *fp, UINT8 num_dim)
Print a dependence vector, printing the bounds of each dimension rather than the direction
Definition at line 253 of file dvector.h.
References DIRECTION_MASK_PRIVATE.
Referenced by DEP_Lex_Pos_Compose(), DEP_Lex_Pos_Decompose(), DEP_Negate(), DEP_Print(), and DEP_UnionDirection().
Definition at line 242 of file dvector.h.
References DEP_IsDistance(), DISTANCE_MASK_PRIVATE, DISTANCE_OFFSET_PRIVATE, and Is_True.
Referenced by DEP_Negate(), and DEP_Print().

Definition at line 248 of file dvector.h.
References DISTANCE_MASK_PRIVATE, and DISTANCE_OFFSET_PRIVATE.
Referenced by DEP_PrintBound().
Definition at line 237 of file dvector.h.
References DISTANCE_FLAG_PRIVATE.
Referenced by DEP_Distance(), DEP_Negate(), and DEP_Print().
Definition at line 341 of file dvector.cxx.
References DEP_Direction(), DEP_Negate(), DEP_UnionDirection(), DIR_EQ, DIR_POSEQ, FALSE, Is_True, and TRUE.

| void DEP_Lex_Pos_Decompose | ( | DEP | dep, | |
| MEM_POOL * | pool, | |||
| DEP ** | pos, | |||
| DEP ** | neg, | |||
| BOOL | keep_pos_equals, | |||
| BOOL | keep_neg_equals | |||
| ) |
Definition at line 274 of file dvector.cxx.
References DEP_Direction(), DEP_Negate(), DEP_SetDirection(), DIR_EQ, DIR_NEG, DIR_NEGEQ, DIR_POS, DIR_POSEQ, DIR_POSNEG, DIR_STAR, NULL, and TYPE_MEM_POOL_ALLOC.

Definition at line 258 of file dvector.h.
References DISTANCE_FLAG_PRIVATE.
Referenced by DEP_SetDistance().
Definition at line 263 of file dvector.h.
References DISTANCE_FLAG_PRIVATE.
Referenced by DEP_Negate(), DEP_SetDirection(), DEP_SetDistance(), and DEP_UnionDirection().
Definition at line 126 of file dvector.cxx.
References DEP_Direction(), DEP_Distance(), DEP_IsDistance(), DEP_MAKE_DIST_NON_CONST_PRIVATE(), DEP_SET_DIR_PRIVATE(), DEP_SET_DIST_PRIVATE(), DEP_SetDistance(), DIR_NEG, DIR_NEGEQ, DIR_POS, and DIR_POSEQ.
Referenced by DEP_Lex_Pos_Compose(), and DEP_Lex_Pos_Decompose().

| void DEP_Print | ( | const DEP | dep, | |
| FILE * | fp | |||
| ) |
Definition at line 192 of file dvector.cxx.
References DEP_Direction(), DEP_Distance(), DEP_IsDistance(), and DIRECTION_Print().
Referenced by DEPV_Print().

| void DEP_PrintBound | ( | const DEP | dep, | |
| FILE * | fp | |||
| ) |
Definition at line 198 of file dvector.cxx.
References DEP_DistanceBound().
Referenced by DEPV_PrintBound().

Definition at line 269 of file dvector.h.
References DIRECTION_MASK_PRIVATE.
Referenced by DEP_Negate(), DEP_SetDirection(), and DEP_SetDistance().
Definition at line 278 of file dvector.h.
References DISTANCE_MASK_PRIVATE, and DISTANCE_OFFSET_PRIVATE.
Referenced by DEP_Negate(), DEP_SetDirection(), DEP_SetDistance(), and DEP_UnionDirection().
Dependence Vectors -------------------
Description:
This is the basic data structure used to represent loop dependences. A dependence vector is an array of dependences, one for each enclosing do loop. Each dependence is a mixed distance direction: i.e. either a constant integer or a union of directions.
See dvector.h for exported routines
Definition at line 83 of file dvector.cxx.
References DEP_MAKE_DIST_NON_CONST_PRIVATE(), DEP_SET_DIR_PRIVATE(), DEP_SET_DIST_PRIVATE(), DEP_SetDistance(), DIR_EQ, DIR_NEG, and DIR_POS.
Referenced by DEP_Lex_Pos_Decompose(), DEPV_CreateEqual(), and DEPV_CreateStar().

Definition at line 152 of file dvector.cxx.
References DEP_MAKE_DIST_CONST_PRIVATE(), DEP_MAKE_DIST_NON_CONST_PRIVATE(), DEP_SET_DIR_PRIVATE(), DEP_SET_DIST_PRIVATE(), DIR_EQ, DIR_NEG, DIR_POS, MAX_BOUND_PRIVATE, MAX_DISTANCE_PRIVATE, and MIN_DISTANCE_PRIVATE.
Referenced by DEP_Negate(), and DEP_SetDirection().

Definition at line 105 of file dvector.cxx.
References DEP_Direction(), DEP_MAKE_DIST_NON_CONST_PRIVATE(), DEP_SET_DIST_PRIVATE(), DIR_EQ, DIR_NEG, and DIR_POS.
Referenced by DEP_Lex_Pos_Compose().

Definition at line 225 of file dvector.cxx.
References DEP_SetDirection(), DIR_EQ, and TYPE_MEM_POOL_ALLOC_N.

Definition at line 213 of file dvector.cxx.
References DEP_SetDirection(), DIR_STAR, and TYPE_MEM_POOL_ALLOC_N.

Definition at line 297 of file dvector.h.
References MEM_POOL_FREE().

Definition at line 251 of file dvector.cxx.
References DEP_Print(), and DEPV_Dep.

Definition at line 262 of file dvector.cxx.
References DEP_PrintBound(), and DEPV_Dep.

| void DIRECTION_Print | ( | DIRECTION | dir, | |
| FILE * | fp | |||
| ) |
Definition at line 178 of file dvector.cxx.
References DIR_EQ, DIR_NEG, DIR_NEGEQ, DIR_POS, DIR_POSEQ, DIR_POSNEG, DIR_STAR, and Is_True.
Referenced by DEP_Print().
1.5.7.1