Next: Loop distribution
Up: Simple functions
Previous: Loop removing transformation
The unrolling and jam transformation must be applied to a perfect nest of do-loop statements. It unrolls the body of one of the inner loops according to the outer loop variable index. When the inner loop is the outer loop (the inner loop of level 0), the unrolling and jam transformation is equivalent to a classical loop unrolling. The knowledge of the sign SIGN of the outer loop step is necessary to obtain an efficient unrolling. This information can be computed automatically or can be specified by the user.
-
Fits:UnrollJam:Check(AST,DIAGMESG,LEVEL,FACTOR)
-
This functions check if the unrolling and jam transformation can be applied to AST.
- LOOPS (input AST) must be a perfect nest of do-loop statements
- DIAGMESG (output STRING) is the diagnostic string
- LEVEL (input INT) is the level of the inner loop
- 0 for the outer loop
- 1 for the first inner loop
- >1 for another inner loop
- FACTOR (input INT) is the unrolling factor.
- The function returns an error code (return INT):
- 1 if all is correct
- 0 if AST is not a perfect nest of do-loops of level LEVEL
- -1 if the inner loop contains statements that are not handled by the transformation.
- -2 if SIGN does not match the sign of the outer loop step.
- -3 if FACTOR is lower or equal to 1
-
Fits:UnrollJam:Advice(AST,DIAGMESG,LEVEL,FACTOR)
-
This function emits a diagnostic about the interest of the loop unrolling transformation
- LOOPS (input AST) must be a perfect nest of do-loop statements
- DIAGMESG (output STRING) is a diagnostic string for the user
- LEVEL (input INT) is the level of the inner loop
- 0 for the outer loop
- 1 for the first inner loop
- >1 for another inner loop
- FACTOR (input INT) is the unrolling factor
- SIGN (input INT) is the sign of the outer loop step
- -1 for a negative sign.
- 0 for an unknown sign.
- 1 for a positive sign.
- The function returns a diagnostic code (return INT) :
- 1 if the transformation is recommended
- 0 if the transformation may be interesting
- -1 if the transformation in not recommended
-
Fits:UnrollJam:Safe(AST,DIAGMESG,LEVEL,FACTOR)
-
This function emits a diagnostic about the code produced by the transformation
- LOOPS (input AST) must be a perfect nest of do-loop statements
- DIAGMESG (output STRING) is a diagnostic string for the user
- LEVEL (input INT) is the level of the inner loop
- 0 for the outer loop
- 1 for the first inner loop
- >1 for another inner loop
- FACTOR (input INT) is the unrolling factor
- SIGN (input/output INT) is the sign of the outer loop step
- -1 for a negative sign.
- 0 for an unknown sign.
- 1 for a positive sign.
- The function returns a diagnostic code (return INT) :
- 1 if the transformation is safe
- 0 if the transformation may be safe. More information is given by the text in DIAGMESG.
- -1 if the transformation is not safe
-
Fits:UnrollJam:Apply(DESC,LEVEL,FACTOR)
-
This function applies the unroll-and-jam transformation to the loop
specified by the descriptor DESC.
- DESC (input LOOPDESC) must be a loop descriptor
- LEVEL (input INT) is the level of the inner loop
- 0 for the outer loop
- 1 for the first inner loop
- >1 for another inner loop
- FACTOR (input INT) is the unrolling factor
Next: Loop distribution
Up: Simple functions
Previous: Loop removing transformation
Yann Mevel
1999-04-30