next up previous contents index
Next: The loop blocking transformation Up: Simple functions Previous: Loop fusion

loop interchanging

The loop interchanging transformation exchanges the indexes, the bounds and the steps of two nested do-loops statements ; the outer loop and an inner loop given by its internal level.

$\vartriangleright$ Example 64:  Interchange of the first and the third loops (indexes I and K). The level is 2.

    DO I=1,N
      DO J=2,M
        DO K=2,M
          CALL F(I,J,K)
        ENDDO
      ENDDO
    ENDDO
$\longrightarrow$
   DO K=2,M
     DO J=2,M
       DO I=1,N
         CALL F(I,J,K)
       ENDDO
     ENDDO
   ENDDO

  $\blacktriangleright$ Fits:LoopExchangeMulti:Check(OUTLOOP,DIAGMESG,LEVEL)
 
This function checks if the loop interchanging transformation can be applied to OUTLOOP.

  $\blacktriangleright$ Fits:LoopExchangeMulti:Advice(OUTLOOP,DIAGMESG,LEVEL)
 
This function emits a diagnostic about the interest of the loop interchanging transformation applied to OUTLOOP.
  $\blacktriangleright$ Fits:LoopExchangeMulti:Safe(OUTLOOP,DIAGMESG,LEVEL)
 
This function emits a diagnostic about the code produced by the loop interchanging transformation applied to OUTLOOP.
  $\blacktriangleright$ Fits:LoopExchangeMulti:Safe(DESC,VERBOSE,LEVEL)
 
This function applies the loop interchanging transformation to the loop OUTLOOP.


next up previous contents index
Next: The loop blocking transformation Up: Simple functions Previous: Loop fusion
Yann Mevel
1999-04-30