Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
dvector.h File Reference
#include "defs.h"
#include "errors.h"
#include "mempool.h"
Include dependency graph for dvector.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define DISTANCE_FLAG_PRIVATE   0x8000
#define DISTANCE_MASK_PRIVATE   0x0FFF
#define DISTANCE_OFFSET_PRIVATE   2048
#define DIRECTION_MASK_PRIVATE   0x7000
#define MAX_BOUND_PRIVATE   4095
#define MAX_DISTANCE_PRIVATE   2047
#define MIN_DISTANCE_PRIVATE   -2048
#define DEPV_Dep(depv, i)   depv[i]

Typedefs

typedef mINT16 DEP
typedef DEP DEPV

Enumerations

enum  DIRECTION {
  DIR_POS = 1, DIR_NEG = 2, DIR_EQ = 4, DIR_POSNEG = 3,
  DIR_POSEQ = 5, DIR_NEGEQ = 6, DIR_STAR = 7, UNKNOWN_DIRECTION,
  MACHINE_TO_PSEUDO, PSEUDO_TO_MACHINE
}

Functions

DEP DEP_SetDistance (INT32 distance)
void DEP_Lex_Pos_Decompose (DEP dep, MEM_POOL *pool, DEP **pos, DEP **neg, BOOL keep_pos_equals, BOOL keep_neg_equals)
DEP DEP_Lex_Pos_Compose (DEP *pos, DEP *neg, BOOL *pos_has_eq, BOOL *neg_has_eq)
BOOL DEP_IsDistance (DEP dep)
INT32 DEP_Distance (DEP dep)
UINT32 DEP_DistanceBound (DEP dep)
DIRECTION DEP_Direction (DEP dep)
DEP DEP_MAKE_DIST_CONST_PRIVATE (DEP dep)
DEP DEP_MAKE_DIST_NON_CONST_PRIVATE (DEP dep)
DEP DEP_SET_DIR_PRIVATE (DEP dep, DIRECTION direction)
DEP DEP_SET_DIST_PRIVATE (DEP dep, INT32 distance)
void DEPV_Free (MEM_POOL *mem_pool, DEPV *depv)
DEP DEP_SetDirection (DIRECTION direction)
DEP DEP_UnionDirection (DEP dep, DIRECTION direction)
DEP DEP_Negate (DEP dep)
void DIRECTION_Print (DIRECTION dir, FILE *fp)
void DEP_Print (const DEP dep, FILE *fp)
void DEP_PrintBound (const DEP dep, FILE *fp)
DEPVDEPV_Create (MEM_POOL *mem_pool, UINT8 num_dim)
DEPVDEPV_CreateStar (MEM_POOL *mem_pool, UINT8 num_dim)
DEPVDEPV_CreateEqual (MEM_POOL *mem_pool, UINT8 num_dim)
DEPVDEPV_Copy (MEM_POOL *mem_pool, DEPV *depv, UINT8 num_dim)
void DEPV_Print (const DEPV *depv, FILE *fp, UINT8 num_dim)
void DEPV_PrintBound (const DEPV *depv, FILE *fp, UINT8 num_dim)

Define Documentation

#define DEPV_Dep (   depv,
 
)    depv[i]

Definition at line 294 of file dvector.h.

Referenced by DEPV_Print(), and DEPV_PrintBound().

#define DIRECTION_MASK_PRIVATE   0x7000

Definition at line 225 of file dvector.h.

Referenced by DEP_Direction(), and DEP_SET_DIR_PRIVATE().

#define DISTANCE_FLAG_PRIVATE   0x8000
#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

Definition at line 226 of file dvector.h.

Referenced by DEP_SetDistance().

#define MAX_DISTANCE_PRIVATE   2047

Definition at line 227 of file dvector.h.

Referenced by DEP_SetDistance().

#define MIN_DISTANCE_PRIVATE   -2048

Definition at line 228 of file dvector.h.

Referenced by DEP_SetDistance().


Typedef Documentation

typedef mINT16 DEP

Definition at line 220 of file dvector.h.

typedef DEP DEPV

Definition at line 291 of file dvector.h.


Enumeration Type Documentation

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.

BOOL DEP_IsDistance(DEP Dep)

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.

DEP DEP_Negate(DEP dep)

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

Enumerator:
DIR_POS 
DIR_NEG 
DIR_EQ 
DIR_POSNEG 
DIR_POSEQ 
DIR_NEGEQ 
DIR_STAR 
UNKNOWN_DIRECTION 
MACHINE_TO_PSEUDO 
PSEUDO_TO_MACHINE 

Definition at line 206 of file dvector.h.


Function Documentation

INT32 DEP_Distance ( DEP  dep) [inline]

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().

Here is the call graph for this function:

UINT32 DEP_DistanceBound ( DEP  dep) [inline]

Definition at line 248 of file dvector.h.

References DISTANCE_MASK_PRIVATE, and DISTANCE_OFFSET_PRIVATE.

Referenced by DEP_PrintBound().

BOOL DEP_IsDistance ( DEP  dep) [inline]

Definition at line 237 of file dvector.h.

References DISTANCE_FLAG_PRIVATE.

Referenced by DEP_Distance(), DEP_Negate(), and DEP_Print().

DEP DEP_Lex_Pos_Compose ( DEP pos,
DEP neg,
BOOL pos_has_eq,
BOOL neg_has_eq 
)

Definition at line 341 of file dvector.cxx.

References DEP_Direction(), DEP_Negate(), DEP_UnionDirection(), DIR_EQ, DIR_POSEQ, FALSE, Is_True, and TRUE.

Here is the call graph for this function:

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.

Here is the call graph for this function:

DEP DEP_MAKE_DIST_CONST_PRIVATE ( DEP  dep) [inline]

Definition at line 258 of file dvector.h.

References DISTANCE_FLAG_PRIVATE.

Referenced by DEP_SetDistance().

void DEP_Print ( const DEP  dep,
FILE *  fp 
)

Definition at line 192 of file dvector.cxx.

References DEP_Direction(), DEP_Distance(), DEP_IsDistance(), DIRECTION_Print(), and fprintf().

Referenced by DEPV_Print().

Here is the call graph for this function:

void DEP_PrintBound ( const DEP  dep,
FILE *  fp 
)

Definition at line 198 of file dvector.cxx.

References DEP_DistanceBound(), and fprintf().

Referenced by DEPV_PrintBound().

Here is the call graph for this function:

DEP DEP_SET_DIR_PRIVATE ( DEP  dep,
DIRECTION  direction 
) [inline]

Definition at line 269 of file dvector.h.

References DIRECTION_MASK_PRIVATE.

Referenced by DEP_Negate(), DEP_SetDirection(), and DEP_SetDistance().

DEP DEP_SET_DIST_PRIVATE ( DEP  dep,
INT32  distance 
) [inline]
DEP DEP_SetDirection ( DIRECTION  direction)

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().

Here is the call graph for this function:

DEP DEP_UnionDirection ( DEP  dep,
DIRECTION  direction 
)

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().

Here is the call graph for this function:

DEPV* DEPV_Copy ( MEM_POOL mem_pool,
DEPV depv,
UINT8  num_dim 
)

Definition at line 237 of file dvector.cxx.

References result, and TYPE_MEM_POOL_ALLOC_N.

DEPV* DEPV_Create ( MEM_POOL mem_pool,
UINT8  num_dim 
)

Definition at line 204 of file dvector.cxx.

References TYPE_MEM_POOL_ALLOC_N.

DEPV* DEPV_CreateEqual ( MEM_POOL mem_pool,
UINT8  num_dim 
)

Definition at line 225 of file dvector.cxx.

References DEP_SetDirection(), DIR_EQ, and TYPE_MEM_POOL_ALLOC_N.

Here is the call graph for this function:

DEPV* DEPV_CreateStar ( MEM_POOL mem_pool,
UINT8  num_dim 
)

Definition at line 213 of file dvector.cxx.

References DEP_SetDirection(), DIR_STAR, and TYPE_MEM_POOL_ALLOC_N.

Here is the call graph for this function:

void DEPV_Free ( MEM_POOL mem_pool,
DEPV depv 
) [inline]

Definition at line 297 of file dvector.h.

References MEM_POOL_FREE.

void DEPV_Print ( const DEPV depv,
FILE *  fp,
UINT8  num_dim 
)

Definition at line 251 of file dvector.cxx.

References DEP_Print(), DEPV_Dep, and fprintf().

Here is the call graph for this function:

void DEPV_PrintBound ( const DEPV depv,
FILE *  fp,
UINT8  num_dim 
)

Definition at line 262 of file dvector.cxx.

References DEP_PrintBound(), DEPV_Dep, and fprintf().

Here is the call graph for this function:

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, fprintf(), and Is_True.

Referenced by DEP_Print().

Here is the call graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines