Next: Simple functions
Up: Fits functions
Previous: Constants
Most of the transformations applicable to loops require contextual
informations. Rather than to recompute them each time, they are stored in
descriptors. Several descriptors stored in a AST structure can be used to describe the
structure of a nest of loops. Each transformation updates the AST as well as
the associated descriptors. A loop descriptor is stored in an undocumented
type of name LOOPDESC. The additional module name is LoopDesc (i.e.
the full module name is Fits:LoopDesc).
The loop descriptors are created by the following functions:
-
Fits:LoopDesc:Create(LOOP)
-
This function create a loop descriptor associated to the loop LOOP.
- LOOP (input AST) must be a do-loop statement
- The function returns the loop descriptor (LOOPDESC)
-
Fits:LoopDesc:RecursiveInit(DESC,DEPTH)
-
This statement analyses the nest of loops defined by the loop descriptor
DESC (i.e. the outer loop). For each inner loop, a descriptor is
created and added in the AST structure. DESC is the root of the
AST.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- DEPTH (input INT) is the depth of the recursive analysis.
Some functions are provided to find nodes in a AST of descriptors.
-
Fits:LoopDesc:Parent(DESC)
-
This function returns the element on top of DESC in the AST of descriptors.
If the parent does not exist, a new descriptor is created with a loop equal to FALSE.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- The attribute returns a loop descriptor (LOOPDESC). If there is no
parent then a loop descriptor with a statement equal to FALSE is created.
-
Fits:LoopDesc:NbChildren(DESC)
-
This attribute returns the number of children of DESC.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- The attribute returns a positive integer value (INTEGER).
-
Fits:LoopDesc:Rank(DESC)
-
This attribute returns the rank of the loop descriptor DESC in the children
list of its parent.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- The attribute returns a positive integer value (INTEGER).
-
Fits:LoopDesc:Child(DESC,NUM)
-
This attribute returns the child of rank NUM of the loop descriptor DESC.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- NUM (input) must be an index .
- The attribute returns a loop descriptor (LOOPDESC).
Several informations are stored in a loop descriptor. They can be accessed by
the following functions and statements:
- The statement associated to the loop. This is probably a DO loop.
-
Fits:LoopDesc:GetStatement(DESC)
-
This function returns the statement (i.e. the loop) associated to the loop
descriptor DESC.
- DESC (input LOOPDESC) must be a loop descriptor.
- The function returns the loop (AST).
-
Fits:LoopDesc:SetStatement(DESC,LOOP)
-
This statement puts the statement (i.e. the loop) associated to the loop
descriptor DESC to LOOP.
- DESC(input/output LOOPDESC) must be a loop descriptor.
- LOOP (input AST) must be a do-loop statement.
- The function returns the loop (AST).
- The execution status indicates if the loop is executed at least once.
The allowed values are Fits:No, Fits:Maybe or Fits:Yes.
-
Fits:LoopDesc:GetExecutionStatus(DESC)
-
This function gets the execution status.
- DESC (input LOOPDESC) must be a loop descriptor.
- The attribute returns one the values Fits:No, Fits:Maybe or Fits:Yes.
-
Fits:LoopDesc:SetExecutionStatus(DESC,VALUE)
-
This function puts the execution status.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- VALUE (input INT) is one the values Fits:No, Fits:Maybe or Fits:Yes.
- The global scope status of the loop index indicates if the index can be
used in the loop body without being referenced. When it is set, some
transformations are not allowed to modify the index (i.e. its name and its
value) in the body of the loop. The allowed values are Fits:No, Fits:Maybe
or Fits:Yes.
-
Fits:LoopDesc:GetIndexGlobalScope(DESC)
-
This attribute gets the global scope status.
- DESC (input LOOPDESC) must be a loop descriptor.
- The attribute returns one the values Fits:No, Fits:Maybe or Fits:Yes.
-
Fits:LoopDesc:SetIndexGlobalScope(DESC,VALUE)
-
This statement puts in the loop descriptor DESC if the loop index
has a global scope.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- VALUE (input INT) is one the values Fits:No, Fits:Maybe or Fits:Yes.
- The local scope status of the loop index indicates if the index is used
after the loop. For several transformations, it means that the original
value of the index must be restored after the loop. The allowed values are
Fits:No, Fits:Maybe or Fits:Yes.
-
Fits:LoopDesc:GetIndexExitUsage(DESC)
-
This attribute gets the local scope status.
- DESC (input LOOPDESC) must be a loop descriptor.
- The attribute returns one the values Fits:No, Fits:Maybe or Fits:Yes.
-
Fits:LoopDesc:SetIndexExitUsage(DESC,VALUE)
-
This statement puts in the loop descriptor DESC if the loop index
is local to the loop (see before).
- DESC (input/output LOOPDESC) must be a loop descriptor.
- VALUE (input INT) is one the values Fits:No, Fits:Maybe or Fits:Yes.
- The positive step status indicate if the step of the loop is positive.
The allowed values are Fits:No, Fits:Maybe or Fits:Yes.
-
Fits:LoopDesc:GetPositiveStep(DESC)
-
This attribute looks in the loop descriptor DESC if the loop index is
positive.
- DESC (input LOOPDESC) must be a loop descriptor.
- The attribute returns one the values Fits:No, Fits:Maybe or Fits:Yes.
-
Fits:LoopDesc:SetPositiveStep(DESC,VALUE)
-
This statement puts in the loop descriptor DESC if the loop step is
positive.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- VALUE (input INT) is one the values Fits:No, Fits:Maybe or Fits:Yes.
- This ending status indicates if the end of the bounds is allways reached
by the loop. This information may improve the calculation of the exit value
of the index.
-
Fits:LoopDesc:GetEndIsReached(DESC)
-
This function looks in the loop descriptor DESC if the loop end bound
is reached.
- DESC (input LOOPDESC) must be a loop descriptor.
- The function returns one the values Fits:No, Fits:Maybe or Fits:Yes.
-
Fits:LoopDesc:SetEndIsReached(DESC,VALUE)
-
This statement puts in the loop descriptor DESC if the loop end bound
is reached.
- DESC (input/output LOOPDESC) must be a loop descriptor.
- VALUE (input INT) is one the values Fits:No, Fits:Maybe or Fits:Yes.
Next: Simple functions
Up: Fits functions
Previous: Constants
Yann Mevel
1999-04-30