SSP and Sibling loops, Technical memo #1 - Delaware 2005

Mar 1, 2005 - 3 Possible solutions. 6. 3.1 DDG . ... 6Sn is traditionnaly the number of stages of the inner most loop, this value is needed by the SSP algorithm.
286KB taille 5 téléchargements 189 vues
SSP and Sibling loops, Technical memo #1 STRASSER Michel



March 1, 2005

Contents 1 Motivation

2

2 Issues to solve 2.1 DDG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Register allocation . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Code generation . . . . . . . . . . . . . . . . . . . . . . . . .

5 5 5 5

3 Possible solutions 3.1 DDG . . . . . . . . . . . . . . . . 3.2 Register allocation . . . . . . . . 3.3 Code generation . . . . . . . . . 3.3.1 Two kernels . . . . . . . . 3.3.2 One kernel and predicates 3.3.3 Overlapping sibling loops



CAPSL, University of Delaware

1

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

6 6 7 7 7 8 12

1

Motivation

SSP can not handle with sibling loops. In fact there are a lot of established algorithm that don’t care about sibling loops. There are some loop transformations that precedes the application of SSP, like loop fusion or loop fission, but those may not always succeed.

Since Open64 is said to be DFT 1 one may dump the WHIRL2 into a file just before SSP is invoked and watch if one can always loop fusion sibling loops 3 . The following source code has been tested to show the CFG just before SSP is applied. We add some extra code in Open64 so that the CFG is dumped and showed at screen at compilation time. Figure 1 is a screenshot of such a CFG rendered by udraw 4 . #include #define N1 3 #define N2 5 int main (int argc, char∗∗ argv) { int U[N1][N2]={ {0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}, {10, 11, 12, 13, 14}}; int V[N1][N2]; int i1, i2; for(i1=0 ; i1