├── test ├── oc.out ├── 0D-1.cloog ├── 0D-2.cloog ├── 1point-2.c ├── no_lindep.c ├── openscop │ ├── coordinates_orig.c │ ├── clay_orig.c │ ├── loops.orig.c │ ├── coordinates.c │ ├── empty.c │ ├── clay.c │ ├── empty.good.c │ ├── coordinates.good.c │ ├── matmult.c │ ├── union.c │ ├── clay.good.c │ ├── empty.scop │ ├── union.good.c │ └── matmult.good.c ├── reports │ ├── fabrice_baray_29-10-2004 │ ├── michael_classen_27-10-2004.txt │ ├── sergej_schwenk_01-06-2004.txt │ ├── sylvain_girbal_01-11-2004.txt │ ├── sylvain_girbal_24-02-2004.txt │ └── nicolas_vasilache_09-05-2005.txt ├── 0D-1.c ├── 0D-3.c ├── 0D-3.cloog ├── multi-stride.c ├── 1point-1.c ├── backtrack.c ├── basic-bounds-2.c ├── basic-bounds-6.c ├── singleton.c ├── 0D-2.c ├── reservoir │ ├── two.c │ ├── stride.c │ ├── stride2.c │ ├── jacobi2.c │ ├── bastoul3.c │ ├── fusion1.c │ ├── loechner3.c │ ├── pingali4.c │ ├── lim-lam6.c │ ├── pingali2.c │ ├── loechner4.c │ ├── loechner5.c │ ├── pingali3.c │ ├── fusion2.c │ ├── two.cloog │ ├── lim-lam2.c │ ├── lim-lam5.c │ ├── tang-xue1.c │ ├── bastoul3.cloog │ ├── lim-lam4.c │ ├── long.c │ ├── pingali1.c │ ├── lim-lam1.c │ ├── pingali5.c │ ├── jacobi2.good.c │ ├── two.good.c │ ├── pingali6.c │ ├── jacobi3.c │ ├── bastoul3.good.c │ ├── stride.good.c │ ├── stride2.good.c │ ├── jacobi2.cloog │ ├── cholesky2.c │ ├── loechner3.good.c │ ├── fusion1.good.c │ ├── loechner5.good.c │ ├── stride.cloog │ ├── pingali2.good.c │ ├── pingali4.good.c │ ├── stride2.cloog │ ├── loechner4.good.c │ └── pingali3.good.c ├── block3.c ├── isl │ ├── unroll.cloog │ ├── unroll2.cloog │ ├── mod.c │ ├── mod2.c │ ├── unroll2.c │ ├── unroll.c │ ├── mod4.c │ ├── mod3.c │ ├── mxm-shared.c │ ├── mod2.cloog │ ├── mod.cloog │ ├── mod4.cloog │ ├── jacobi-shared.c │ ├── stride.cloog │ ├── unroll2.good.c │ ├── stride.c │ ├── unroll.good.c │ ├── mod.good.c │ ├── mod2.good.c │ ├── mod3.cloog │ ├── mod4.good.c │ └── mod3.good.c ├── block.c ├── infinite4.c ├── basic-bounds-5.c ├── lex.c ├── multi-stride2.c ├── basic-bounds-1.c ├── basic-bounds-3.c ├── basic-bounds-4.c ├── nul_basic1.c ├── iftest.c ├── iftestf.f ├── block2.c ├── stride2.c ├── infinite4.cloog ├── nul_basic2.c ├── param-split.cloog ├── rectangle.c ├── stride3.c ├── stride4.c ├── merge.c ├── min-3-1.c ├── singleton.cloog ├── walters3.c ├── tiling.c ├── param-split.c ├── stride.c ├── largeur.c ├── dot.c ├── iftest2.c ├── min-4-1.c ├── guide.c ├── mod4.c ├── non_optimal │ ├── youcef.c │ ├── nul_complex1.c │ ├── nul_complex1.cloog │ ├── dreamupT3.omega │ ├── dreamupT1.cloog │ ├── youcef.cloog │ ├── deuxpts.cloog │ ├── nul_complex1.good.c │ └── youcef.good.c ├── basic-bounds-6.cloog ├── backtrack.cloog ├── basic-bounds-1.cloog ├── basic-bounds-2.cloog ├── wavefront.c ├── min-1-1.c ├── infinite2.c ├── uday_scalars.c ├── donotsimp.c ├── ceilfloor.cloog ├── double.c ├── multi-mm-1.c ├── basic-bounds-3.cloog ├── basic-bounds-4.cloog ├── block3.cloog ├── gesced3.c ├── forwardsub-1-1-2.c ├── union.cloog ├── lineality-1-2.c ├── stride.cloog ├── stride2.cloog ├── infinite.c ├── 1point-2.cloog ├── tete.cloog ├── 1point-1.cloog ├── basic-bounds-5.cloog ├── forwardsub-2-1-2-3.c ├── equality.c ├── min-2-1.c ├── walters2.c ├── lex.cloog ├── lub.c ├── dot2.c ├── rational.cloog ├── union.c ├── multi-stride.cloog ├── multi-stride2.cloog ├── square+triangle-1-1-2-3.c ├── emploi.c ├── esced.c ├── ispdc.cloog ├── min-3-1.cloog ├── nul_lcpc.c ├── lineality-2-1-2.c ├── no_lindep.cloog ├── merge.cloog ├── min-4-1.cloog ├── constbound.c ├── infinite3.c ├── wavefront.cloog ├── ard.dat ├── infinite.omega ├── block.cloog ├── largeur.cloog ├── nul_basic1.cloog ├── ex1.c ├── 4-param.c ├── christian.c ├── constant.c ├── dot2.cloog ├── esced.cloog ├── rectangle.cloog ├── logo.c ├── published │ ├── CC2003 │ │ └── esced.cloog │ ├── Web │ │ └── web7.cloog │ └── PACT2004 │ │ └── youcefn.cloog ├── test.c ├── gesced.c ├── tiling.cloog ├── gauss.c ├── logo.cloog ├── min-1-1.cloog ├── logopar.c ├── yosrf.f ├── 0D-1.good.c ├── 0D-3.good.c ├── infinite.cloog ├── infinite2.cloog ├── infinite3.cloog ├── dealII.c ├── 4-param.cloog ├── ex1.cloog ├── forwardsub-3-1-2.c ├── byu98-1-2-3.c ├── diagonal.cloog ├── equality.cloog ├── lu.c ├── lu2.c ├── lux.c ├── 0D-2.good.c ├── durbin_e_s.c ├── yosr.c ├── test.cloog ├── mode.cloog ├── stage.cloog ├── yosr2.c ├── singleton.good.c ├── lineality-2-1-2.cloog ├── multi-mm-1.cloog ├── dot.cloog ├── square+triangle-1-1-2-3.cloog ├── readme.cloog ├── yosr.omega ├── basic-bounds-2.good.c ├── basic-bounds-6.good.c ├── tiling2.cloog ├── equality2.c ├── logopar.cloog ├── mode.c ├── walters.c ├── min-2-1.cloog ├── gesced3.cloog ├── stride4.cloog ├── 1point-1.good.c ├── ard.cloog ├── lineality-1-2.cloog ├── backtrack.good.c ├── basic-bounds-1.good.c ├── basic-bounds-3.good.c ├── basic-bounds-4.good.c ├── basic-bounds-5.good.c ├── 1point-2.good.c ├── quillere.cloog ├── min-4-1.good.c ├── gesced2.c ├── iftest.cloog ├── overlap.cloog ├── iftestf.cloog ├── no_lindep.good.c ├── min-3-1.good.c ├── multi-stride.good.c ├── lex.good.c ├── tiling.good.c ├── block.good.c ├── block3.good.c ├── iftest.good.c ├── tiling3.cloog ├── infinite4.good.c ├── largeur.good.c ├── min-1-1.good.c ├── lux.cloog ├── vasilache.c ├── lu2.cloog ├── stride2.good.c ├── iftest2.cloog ├── param-split.good.c ├── walters3.cloog ├── rectangle.good.c ├── dot.good.c ├── pouchet.c ├── nul_basic1.good.c ├── stride.good.c ├── walters3.good.c ├── youcefn.cloog ├── guide.good.c ├── cholesky.c ├── min-2-1.good.c ├── stride4.good.c ├── block2.good.c ├── lu.cloog ├── multi-stride2.good.c ├── nul_lcpc.cloog ├── uday_scalars.good.c ├── constbound.cloog ├── levenshtein-1-2-3.c ├── levenshtein-1-2-3f.f ├── nul_ispdc.cloog ├── iftest2.good.c ├── merge.good.c ├── wavefront.good.c ├── donotsimp.good.c ├── double.good.c ├── esced.good.c ├── nul_basic2.good.c ├── stride3.good.c ├── equality.good.c ├── dot2.good.c ├── levenshtein-1-2-3f.c ├── infinite2.good.c ├── elimination.cloog ├── walters2.good.c ├── forwardsub-1-1-2.good.c ├── multi-mm-1.good.c ├── union.good.c ├── guide.cloog ├── gesced.cloog ├── gesced3.good.c ├── infinite.good.c ├── darte.cloog ├── lub.good.c ├── 4-param.good.c ├── ex1.good.c ├── dartef.cloog ├── emploi.good.c └── forwardsub-2-1-2-3.good.c ├── get_submodules.sh ├── doc ├── images │ ├── tree.jpg │ ├── tree.pdf │ ├── basic.jpg │ ├── basic.pdf │ ├── basic.txt │ └── tree.txt └── ROADMAP ├── autogen.sh ├── .gitmodules ├── include └── cloog │ ├── isl │ ├── backend.h │ └── cloog.h │ ├── matrix │ └── constraintset.h │ └── input.h ├── genversion.sh.in ├── source ├── mp_get_memory_functions.c ├── version.c.in └── isl │ └── backend.c ├── cmake ├── isl-config.cmake └── cloog-isl-config.cmake ├── .gitignore └── examples └── example └── example.c /test/oc.out: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /get_submodules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | git submodule init 3 | git submodule update 4 | -------------------------------------------------------------------------------- /doc/images/tree.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/doc/images/tree.jpg -------------------------------------------------------------------------------- /doc/images/tree.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/doc/images/tree.pdf -------------------------------------------------------------------------------- /doc/images/basic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/doc/images/basic.jpg -------------------------------------------------------------------------------- /doc/images/basic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/doc/images/basic.pdf -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | autoreconf -i 3 | if test -f isl/autogen.sh; then 4 | (cd isl; ./autogen.sh) 5 | fi 6 | -------------------------------------------------------------------------------- /test/0D-1.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 2 4 | 0 5 | 6 | 1 7 | 8 | 1 9 | 0 2 10 | 0 0 0 11 | 0 12 | 13 | 0 14 | -------------------------------------------------------------------------------- /test/0D-2.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 3 4 | 0 5 | 6 | 1 7 | 8 | 1 9 | 1 3 10 | 1 1 0 11 | 0 0 0 12 | 0 13 | 14 | 0 15 | -------------------------------------------------------------------------------- /test/1point-2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./1point-2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | S1(2*M,(N+2)); 3 | -------------------------------------------------------------------------------- /test/no_lindep.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./no_lindep.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | S1((N+2)); 3 | -------------------------------------------------------------------------------- /test/openscop/coordinates_orig.c: -------------------------------------------------------------------------------- 1 | #pragma scop 2 | for (i = 0; i < 42; i++) { 3 | S1(i); 4 | } 5 | #pragma endscop 6 | -------------------------------------------------------------------------------- /test/reports/fabrice_baray_29-10-2004: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/test/reports/fabrice_baray_29-10-2004 -------------------------------------------------------------------------------- /test/0D-1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/0D-1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | S1() ; 3 | -------------------------------------------------------------------------------- /test/0D-3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/0D-3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | S1() ; 3 | -------------------------------------------------------------------------------- /test/0D-3.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 1 3 4 | 1 1 0 5 | 0 6 | 7 | 1 8 | 9 | 1 10 | 1 3 11 | 1 1 0 12 | 0 0 0 13 | 0 14 | 15 | 0 16 | -------------------------------------------------------------------------------- /test/multi-stride.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/multi-stride.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | -------------------------------------------------------------------------------- /test/reports/michael_classen_27-10-2004.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/test/reports/michael_classen_27-10-2004.txt -------------------------------------------------------------------------------- /test/reports/sergej_schwenk_01-06-2004.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/test/reports/sergej_schwenk_01-06-2004.txt -------------------------------------------------------------------------------- /test/reports/sylvain_girbal_01-11-2004.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/test/reports/sylvain_girbal_01-11-2004.txt -------------------------------------------------------------------------------- /test/reports/sylvain_girbal_24-02-2004.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/test/reports/sylvain_girbal_24-02-2004.txt -------------------------------------------------------------------------------- /test/1point-1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/1point-1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | S1(2*M,M) ; 3 | -------------------------------------------------------------------------------- /test/backtrack.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/backtrack.cloog by CLooG 0.14.0-367-gf043665 gmp bits in 0.00s. */ 2 | S1(0); 3 | -------------------------------------------------------------------------------- /test/reports/nicolas_vasilache_09-05-2005.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/periscop/cloog/HEAD/test/reports/nicolas_vasilache_09-05-2005.txt -------------------------------------------------------------------------------- /test/basic-bounds-2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | S1(0) ; 3 | -------------------------------------------------------------------------------- /test/basic-bounds-6.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-6.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | S1(-1) ; 3 | -------------------------------------------------------------------------------- /test/singleton.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/singleton.cloog by CLooG 0.14.0-242-g720faff gmp bits in 0.00s. */ 2 | S2(); 3 | S1(); 4 | -------------------------------------------------------------------------------- /test/0D-2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/0D-2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | if (M >= 0) { 3 | S1() ; 4 | } 5 | -------------------------------------------------------------------------------- /test/reservoir/two.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/./reservoir/two.cloog by CLooG 0.14.0-225-g6e2d019 gmp bits in 0.00s. */ 2 | S1(1,1,5); 3 | -------------------------------------------------------------------------------- /test/block3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/block3.cloog by CLooG 0.16.2-4-gba4e834 gmp bits in 0.00s. */ 2 | S1(); 3 | S3(0); 4 | S2(); 5 | S3(1); 6 | -------------------------------------------------------------------------------- /test/isl/unroll.cloog: -------------------------------------------------------------------------------- 1 | C 2 | 3 | [n] -> { : } 4 | 5 | 0 6 | 7 | 1 8 | 9 | [n] -> { [i] : 0 <= i and i <= 10 } 10 | 0 0 0 11 | 12 | 0 13 | 14 | 0 15 | -------------------------------------------------------------------------------- /test/block.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/block.cloog by CLooG 0.14.0-170-g72daac3 gmp bits in 0.00s. */ 2 | S1(); 3 | S3(0); 4 | S2(); 5 | S3(1); 6 | -------------------------------------------------------------------------------- /test/infinite4.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/infinite4.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (;;i++) { 3 | S1(i) ; 4 | } 5 | -------------------------------------------------------------------------------- /test/basic-bounds-5.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-5.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | j = floord(M+1,2) ; 3 | S1(1,j) ; 4 | -------------------------------------------------------------------------------- /test/isl/unroll2.cloog: -------------------------------------------------------------------------------- 1 | C 2 | 3 | [n] -> { : } 4 | 5 | 0 6 | 7 | 1 8 | 9 | [n] -> { [i] : 0 <= i and n <= i <= n + 1 <= 10 } 10 | 0 0 0 11 | 12 | 0 13 | 14 | 0 15 | -------------------------------------------------------------------------------- /test/lex.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/lex.cloog by CLooG 0.14.0-234-g330f397 gmp bits in 0.00s. */ 2 | for (c1=0;c1<=10;c1++) { 3 | S2(c1); 4 | S1(c1); 5 | } 6 | -------------------------------------------------------------------------------- /test/multi-stride2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./multi-stride2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (i=5;i<=100;i+=6) { 3 | S1(i,((i-1)/2),((i-2)/3)); 4 | } 5 | -------------------------------------------------------------------------------- /test/openscop/clay_orig.c: -------------------------------------------------------------------------------- 1 | int i; 2 | #pragma scop 3 | /* Clay 4 | stripmine([0,0],1,4,1); 5 | */ 6 | for (i = 0; i < 42; i++) { 7 | S(i); 8 | } 9 | #pragma endscop 10 | -------------------------------------------------------------------------------- /test/basic-bounds-1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (i=0;i<=2;i++) { 3 | S1(i) ; 4 | } 5 | -------------------------------------------------------------------------------- /test/basic-bounds-3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (i=0;i<=M;i++) { 3 | S1(i) ; 4 | } 5 | -------------------------------------------------------------------------------- /test/basic-bounds-4.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-4.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (i=0;i<=M+1;i++) { 3 | S1(i) ; 4 | } 5 | -------------------------------------------------------------------------------- /test/nul_basic1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./nul_basic1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if (M >= 0) { 3 | for (i=0;i<=M;i+=2) { 4 | S1(i,(i/2)); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/iftest.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/iftest.cloog by CLooG 0.14.0-245-gd8c1718 gmp bits in 0.00s. */ 2 | if (n >= 1) { 3 | for (i=1;i<=n;i++) { 4 | S1(i); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/iftestf.f: -------------------------------------------------------------------------------- 1 | ! Generated from ../../../git/cloog/test/iftestf.cloog by CLooG 0.14.0-245-gd8c1718 gmp bits in 0.00s. 2 | IF (n >= 1) THEN 3 | DO i=1, n 4 | S1(i) 5 | END DO 6 | END IF 7 | -------------------------------------------------------------------------------- /test/isl/mod.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/isl/mod.cloog by CLooG 0.14.0-325-g71fa959 gmp bits in 0.00s. */ 2 | for (i=0;i<=3;i++) { 3 | if (i%3 <= 1) { 4 | S1(i); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/isl/mod2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/isl/mod.cloog by CLooG 0.14.0-325-g71fa959 gmp bits in 0.00s. */ 2 | for (i=0;i<=3;i++) { 3 | if (i%3 <= 1) { 4 | S1(i); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/block2.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/block2.cloog by CLooG 0.14.0-302-g309b32c gmp bits in 0.01s. */ 2 | for (c0=0;c0<=9;c0++) { 3 | S1(c0,1); 4 | S3(c0,1); 5 | S2(c0,1); 6 | } 7 | -------------------------------------------------------------------------------- /test/isl/unroll2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./isl/unroll2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if ((M >= -1) && (M <= 9)) { 3 | if (M >= 0) { 4 | S1(M); 5 | } 6 | S1((M+1)); 7 | } 8 | -------------------------------------------------------------------------------- /test/stride2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./stride2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (c1=3;c1<=100;c1+=3) { 3 | if (c1 == 27) { 4 | S1(27); 5 | } 6 | S2(c1,(c1/3)); 7 | } 8 | -------------------------------------------------------------------------------- /test/infinite4.cloog: -------------------------------------------------------------------------------- 1 | # langage 2 | c 3 | 4 | # Context 5 | 0 2 6 | 0 7 | 8 | 1 # Number of statements 9 | 10 | 1 11 | # {i | 1<=i<=M} 12 | 0 3 13 | 0 0 0 14 | 0 15 | 16 | 0 # Scattering functions 17 | -------------------------------------------------------------------------------- /test/nul_basic2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./nul_basic2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (i=2;i<=n;i+=2) { 3 | if (i%4 == 0) { 4 | S2(i,(i/4)); 5 | } 6 | S1(i,(i/2)); 7 | } 8 | -------------------------------------------------------------------------------- /test/reservoir/stride.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/stride.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if (M >= 2) { 3 | for (c2=2;c2<=M;c2+=7) { 4 | S1(c2,((c2-2)/7)); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/reservoir/stride2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/stride2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if (M >= 2) { 3 | for (c2=2;c2<=M;c2+=7) { 4 | S1(c2,((c2-2)/7)); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "isl"] 2 | path = isl 3 | url = git://repo.or.cz/isl.git 4 | ignore = dirty 5 | [submodule "osl"] 6 | path = osl 7 | url = https://github.com/periscop/openscop.git 8 | ignore = dirty 9 | -------------------------------------------------------------------------------- /test/param-split.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 3 4 | 5 | 0 6 | 7 | 2 8 | 9 | 1 10 | 2 4 11 | 1 1 0 0 12 | 1 -1 1 0 13 | 14 | 0 0 0 15 | 16 | 1 17 | 1 4 18 | 0 1 0 0 19 | 20 | 0 0 0 21 | 22 | 0 23 | 24 | 0 25 | -------------------------------------------------------------------------------- /test/rectangle.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./rectangle.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (c1=0;c1<=2*n;c1++) { 3 | for (i=max(0,c1-n);i<=min(c1,n);i++) { 4 | S1(i,(c1-i)); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/stride3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./stride3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if ((m <= n) && (n >= 1)) { 3 | for (p1=max(50,50*m);p1<=50*n;p1+=50) { 4 | S1((p1/50)); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/stride4.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/stride4.cloog by CLooG 0.16.0-10-g13c6274 gmp bits in 0.00s. */ 2 | if ((t >= 0) && (t <= 15)) { 3 | for (i0=t;i0<=99;i0+=16) { 4 | S1(i0,t); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/merge.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/merge.cloog by CLooG 0.14.0-238-gb1cb779 gmp bits in 0.00s. */ 2 | S1(0); 3 | for (c1=0;c1<=10;c1++) { 4 | if (c1 >= 2) { 5 | S2(c1); 6 | } 7 | S3(c1); 8 | } 9 | -------------------------------------------------------------------------------- /test/min-3-1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/min-3-1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (i=0;i<=min(10,M);i++) { 3 | for (j=0;j<=min(10,M);j++) { 4 | S1(i,j) ; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/singleton.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 2 4 | 5 | 0 6 | 7 | 2 8 | 9 | 1 10 | 0 2 11 | 0 0 0 12 | 13 | 1 14 | 0 2 15 | 0 0 0 16 | 17 | 0 18 | 19 | 2 20 | 21 | 1 3 22 | 0 -1 0 23 | 24 | 1 3 25 | 0 -1 -1 26 | 27 | 0 28 | -------------------------------------------------------------------------------- /test/walters3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./walters3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (j=2;j<=8;j++) { 3 | if (j%2 == 0) { 4 | S1(j,(j/2),(j/2)); 5 | S2(j,(j/2),(j/2)); 6 | } 7 | } 8 | S2(10,5,5); 9 | -------------------------------------------------------------------------------- /test/isl/unroll.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./isl/unroll.cloog by CLooG 0.16.3-13-gbbcc8fc gmp bits in 0.00s. */ 2 | S1(0); 3 | S1(1); 4 | S1(2); 5 | S1(3); 6 | S1(4); 7 | S1(5); 8 | S1(6); 9 | S1(7); 10 | S1(8); 11 | S1(9); 12 | S1(10); 13 | -------------------------------------------------------------------------------- /test/reservoir/jacobi2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/jacobi2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (c2=0;c2<=M-1;c2++) { 3 | for (c4=0;c4<=M-1;c4++) { 4 | S1(c2,c4) ; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/tiling.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/tiling.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (ii=0;ii<=floord(n,10);ii++) { 3 | for (i=10*ii;i<=min(n,10*ii+9);i++) { 4 | S1(ii,i) ; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/param-split.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../test/param-split.cloog by CLooG 0.19.0-6faa51a gmp bits in 0.00s. */ 2 | if (M <= -1) { 3 | S2(0); 4 | } 5 | for (i=0;i<=M;i++) { 6 | S1(i); 7 | if (i == 0) { 8 | S2(i); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/stride.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../test/stride.cloog by CLooG 0.19.0-6faa51a gmp bits in 0.00s. */ 2 | for (c1=3;c1<=100;c1++) { 3 | if (c1%3 == 0) { 4 | S2(c1,(c1/3)); 5 | } 6 | if (c1 == 25) { 7 | S1(25); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/largeur.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/largeur.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | if (M >= 1) { 3 | for (c1=1;c1<=M;c1++) { 4 | for (c2=1;c2<=c1;c2++) { 5 | S1(c2,c1) ; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/reservoir/bastoul3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/bastoul3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (i=3;i<=9;i++) { 3 | for (j=max(i-6,i-2*floord(i+1,2)+2);j<=min(3,i-2);j+=2) { 4 | S1(i,j,((i-j)/2)); 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/dot.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/dot.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (j=1;j<=M;j++) { 3 | S1(0,j) ; 4 | } 5 | for (i=1;i<=N;i++) { 6 | for (j=1;j<=M;j++) { 7 | S2(i,j) ; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/iftest2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/iftest2.cloog by CLooG 0.14.0-245-gd8c1718 gmp bits in 0.00s. */ 2 | if ((M >= 1) && (N >= 1)) { 3 | for (i=1;i<=N;i++) { 4 | for (j=1;j<=M;j++) { 5 | S1(i,j); 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/min-4-1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/min-4-1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if ((M >= -N) && (M >= -O) && (N >= 0) && (N >= -O)) { 3 | for (i=max(-M,-N);i<=min(N,O);i++) { 4 | S1(i) ; 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /test/guide.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/guide.cloog by CLooG 0.14.0-245-gd8c1718 gmp bits in 0.00s. */ 2 | if (N >= 1) { 3 | for (i=1;i<=N;i++) { 4 | S1(i); 5 | } 6 | for (i=N+1;i<=2*N;i++) { 7 | S2(i); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/mod4.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./mod4.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (j=2;j<=10;j+=3) { 3 | S1(j,((j+1)/3),((j+1)/3),2,((j-2)/3)); 4 | S2(j,((j+1)/3),((j+1)/3),2,((j-2)/3)); 5 | S3(j,((j+1)/3),((j+1)/3),2,((j-2)/3)); 6 | } 7 | -------------------------------------------------------------------------------- /test/non_optimal/youcef.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/non_optimal/youcef.cloog by CLooG 0.14.0-238-gb1cb779 gmp bits in 0.00s. */ 2 | for (i=0;i<=5;i++) { 3 | S1(i,i); 4 | for (j=i;j<=5;j++) { 5 | S2(i,j); 6 | } 7 | S3(i,5); 8 | } 9 | -------------------------------------------------------------------------------- /test/basic-bounds-6.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 1 2 6 | 1 1 7 | 0 8 | 9 | 1 # Number of statements 10 | 11 | 1 12 | 3 3 13 | # i 1 14 | 1 2 3 15 | 1 -2 -1 16 | 1 0 1 17 | 0 0 0 18 | 0 19 | 20 | 0 # Scattering functions 21 | -------------------------------------------------------------------------------- /include/cloog/isl/backend.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOOG_ISL_BACKEND_H 2 | #define CLOOG_ISL_BACKEND_H 3 | 4 | #include 5 | 6 | struct cloogbackend { 7 | struct isl_ctx *ctx; 8 | unsigned ctx_allocated : 1; 9 | }; 10 | 11 | #endif /* define _H */ 12 | -------------------------------------------------------------------------------- /test/backtrack.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 2 4 | 5 | 0 6 | 7 | # Number of statements 8 | 1 9 | 10 | 1 # of domains 11 | 1 3 12 | 0 1 0 13 | 0 0 0 14 | 15 | 0 16 | 17 | # of scattering functions 18 | 1 19 | 20 | 2 5 21 | 0 1 0 -1 0 22 | 0 0 1 0 0 23 | 24 | 0 25 | -------------------------------------------------------------------------------- /test/basic-bounds-1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 1 2 6 | 1 1 7 | 0 8 | 9 | 1 # Number of statements 10 | 11 | 1 12 | # 13 | 3 3 14 | # i 1 15 | 1 1 0 16 | 1 -1 2 17 | 1 0 1 18 | 0 0 0 19 | 0 20 | 21 | 0 # Scattering functions 22 | -------------------------------------------------------------------------------- /test/basic-bounds-2.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 1 2 6 | 1 1 7 | 0 8 | 9 | 1 # Number of statements 10 | 11 | 1 12 | # 13 | 3 3 14 | # i 1 15 | 1 3 0 16 | 1 -3 2 17 | 1 0 1 18 | 0 0 0 19 | 0 20 | 21 | 0 # Scattering functions 22 | -------------------------------------------------------------------------------- /test/wavefront.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./wavefront.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if ((m >= 1) && (n >= 1)) { 3 | for (c1=2;c1<=n+m;c1++) { 4 | for (c2=max(1,c1-m);c2<=min(n,c1-1);c2++) { 5 | S1(c2,(c1-c2)); 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/min-1-1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/min-1-1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if ((M >= 0) && (N >= 1)) { 3 | for (i=1;i<=N;i++) { 4 | for (j=0;j<=min(min(M,i),-i+N);j++) { 5 | S1(i,j) ; 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/infinite2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/infinite2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (i=1;i<=N;i++) { 3 | S1(i) ; 4 | for (j=1;j<=M;j++) { 5 | S2(i,j) ; 6 | } 7 | } 8 | for (i=N+1;;i++) { 9 | S1(i) ; 10 | } 11 | -------------------------------------------------------------------------------- /test/uday_scalars.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/uday_scalars.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if (n >= 0) { 3 | for (p3=0;p3<=n;p3++) { 4 | S1(p3,0,0) ; 5 | } 6 | for (p3=0;p3<=n;p3++) { 7 | S2(0,p3,0) ; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/donotsimp.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/donotsimp.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | for (c2=1;c2<=10;c2++) { 3 | for (c4=1;c4<=c2;c4++) { 4 | S1(c2,c4) ; 5 | } 6 | for (c4=11;c4<=M;c4++) { 7 | S2(c2,c4) ; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/isl/mod4.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/isl/mod4.cloog by CLooG 0.16.0-9-g188dbd4 gmp bits in 0.00s. */ 2 | if (M%11 <= 6) { 3 | if (N%5 <= 2) { 4 | if (M >= -N) { 5 | for (i=0;i<=M+N;i++) { 6 | S1(i); 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/openscop/loops.orig.c: -------------------------------------------------------------------------------- 1 | /* matmul.c 128*128 matrix multiply */ 2 | #pragma scop 3 | for(i=0; i= g0+t1+1) && (N >= g1+t0+1) && (t1 <= 7)) { 4 | for (c0=t0;c0<=min(127,N-g1-1);c0+=16) { 5 | S1((g0+t1),(c0+g1)); 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /test/double.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/double.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if (M >= 0) { 3 | for (i=0;i<=M;i++) { 4 | S1(i) ; 5 | for (j=0;j<=N;j++) { 6 | S2(i,j) ; 7 | S3(i,j) ; 8 | } 9 | S4(i) ; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/multi-mm-1.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/multi-mm-1.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.00s. */ 2 | for (i=0;i<=M;i++) { 3 | for (j=0;j<=min(N,i);j++) { 4 | S1(i,j); 5 | S2(i,j); 6 | } 7 | for (j=N+1;j<=i;j++) { 8 | S1(i,j); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/reservoir/fusion1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/fusion1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (c2=0;c2<=M;c2++) { 3 | S1(c2) ; 4 | } 5 | for (c2=1;c2<=M;c2++) { 6 | S2(c2) ; 7 | } 8 | for (c2=0;c2<=M;c2++) { 9 | S3(c2) ; 10 | } 11 | -------------------------------------------------------------------------------- /test/basic-bounds-3.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 2 3 6 | # M 1 7 | 1 1 0 8 | 1 0 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | # 15 | 3 4 16 | # i M 1 17 | 1 1 0 0 18 | 1 -1 1 0 19 | 1 0 0 1 20 | 0 0 0 21 | 0 22 | 23 | 0 # Scattering functions 24 | -------------------------------------------------------------------------------- /test/basic-bounds-4.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 2 3 6 | # M 1 7 | 1 1 0 8 | 1 0 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | # 15 | 3 4 16 | # i M 1 17 | 1 1 0 0 18 | 1 -1 1 1 19 | 1 0 0 1 20 | 0 0 0 21 | 0 22 | 23 | 0 # Scattering functions 24 | -------------------------------------------------------------------------------- /test/block3.cloog: -------------------------------------------------------------------------------- 1 | C 2 | 3 | 0 2 4 | 5 | 0 6 | 7 | 3 8 | 9 | 1 10 | 0 2 11 | 0 0 0 12 | 13 | 1 14 | 0 2 15 | 0 0 0 16 | 17 | 1 18 | 2 3 19 | 1 1 0 20 | 1 -1 1 21 | 0 0 0 22 | 23 | 0 24 | 25 | 3 26 | 27 | 1 3 28 | 0 -1 0 29 | 30 | 1 3 31 | 0 -1 1 32 | 33 | 1 4 34 | 0 -1 1 0 35 | 36 | 0 37 | -------------------------------------------------------------------------------- /test/gesced3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./gesced3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (c1=M+1;c1<=2*M;c1++) { 3 | S1((c1-M)); 4 | } 5 | for (c1=2*M+1;c1<=M+N;c1++) { 6 | S2((c1-2*M)); 7 | S1((c1-M)); 8 | } 9 | for (c1=M+N+1;c1<=2*M+N;c1++) { 10 | S2((c1-2*M)); 11 | } 12 | -------------------------------------------------------------------------------- /test/forwardsub-1-1-2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/forwardsub-1-1-2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | S3(1,1) ; 3 | S1(2,1) ; 4 | S4(2,2) ; 5 | for (i=3;i<=M;i++) { 6 | S1(i,1) ; 7 | for (j=2;j<=i-1;j++) { 8 | S2(i,j) ; 9 | } 10 | S4(i,i) ; 11 | } 12 | -------------------------------------------------------------------------------- /test/union.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 2 4 | 1 3 5 | 1 1 -1 6 | 7 | 1 3 8 | 1 -1 -1 9 | 10 | 0 11 | 12 | 1 13 | 14 | 1 15 | 2 4 16 | 1 1 0 0 17 | 1 -1 0 100 18 | 19 | 0 0 0 20 | 21 | 0 22 | 23 | 1 24 | 2 25 | 2 5 26 | 0 -1 1 0 0 27 | 1 0 0 -1 10 28 | 29 | 2 5 30 | 0 -1 -1 0 0 31 | 1 0 0 1 -11 32 | 33 | 0 34 | -------------------------------------------------------------------------------- /doc/images/basic.txt: -------------------------------------------------------------------------------- 1 | j^ i>=2 2 | | | j<=n+2-i 3 | | |\ | i<=n 4 | | | \ | 5 | m-+-****---+-j<=m 6 | | ***** | 7 | | ****** | 8 | | *******| 9 | 2-+-********-j>=2 10 | | | |\ 11 | 0-+-+------+--->i 12 | | | | 13 | 0 2 n 14 | -------------------------------------------------------------------------------- /test/lineality-1-2.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/lineality-1-2.cloog by CLooG 0.14.0-284-g5c046c9 gmp bits in 0.00s. */ 2 | for (i=1;i<=M;i++) { 3 | for (j=1;j<=i-1;j++) { 4 | S1(i,j); 5 | } 6 | S1(i,i); 7 | S2(i,i); 8 | for (j=i+1;j<=M;j++) { 9 | S1(i,j); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/stride.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 2 4 | 5 | 0 6 | 7 | 2 8 | 9 | 1 10 | 1 3 11 | 0 -1 25 12 | -1 0 0 13 | 14 | 1 15 | 3 4 16 | 1 1 0 -3 17 | 1 -1 0 100 18 | 0 1 -3 0 19 | 0 0 0 20 | 21 | 0 22 | 23 | 2 24 | 2 5 25 | 0 -1 0 1 0 26 | 0 0 -1 0 0 27 | 28 | 2 6 29 | 0 -1 0 1 0 0 30 | 0 0 -1 0 1 0 31 | 32 | 0 33 | -------------------------------------------------------------------------------- /test/stride2.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 2 4 | 5 | 0 6 | 7 | 2 8 | 9 | 1 10 | 1 3 11 | 0 -1 27 12 | -1 0 0 13 | 14 | 1 15 | 3 4 16 | 1 1 0 -3 17 | 1 -1 0 100 18 | 0 1 -3 0 19 | 0 0 0 20 | 21 | 0 22 | 23 | 2 24 | 2 5 25 | 0 -1 0 1 0 26 | 0 0 -1 0 0 27 | 28 | 2 6 29 | 0 -1 0 1 0 0 30 | 0 0 -1 0 1 0 31 | 32 | 0 33 | -------------------------------------------------------------------------------- /test/infinite.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/infinite.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ 2 | for (;i<=0;i++) { 3 | S1(i) ; 4 | } 5 | for (i=1;i<=N;i++) { 6 | S1(i) ; 7 | for (j=1;j<=M;j++) { 8 | S2(i,j) ; 9 | } 10 | } 11 | for (i=N+1;;i++) { 12 | S1(i) ; 13 | } 14 | -------------------------------------------------------------------------------- /test/1point-2.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | #{M,N | } 6 | 1 4 7 | # M N 1 8 | 1 0 0 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | # 15 | 3 6 16 | # i j M N 1 17 | 0 1 0 -2 0 0 18 | 0 2 -2 -4 2 4 19 | 1 0 0 0 0 1 20 | 0 0 0 21 | 0 22 | 23 | 0 # Scattering functions 24 | -------------------------------------------------------------------------------- /test/tete.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | # 2 parameters 4 | 1 4 5 | 1 0 0 0 6 | 7 | 0 8 | 9 | # 1 statement 10 | 1 11 | 12 | # 1 domain 13 | # i=n+2 14 | 1 15 | 2 5 16 | 0 -1 0 1 2 17 | 0 1 0 -1 -3 18 | 0 0 0 19 | 20 | 0 21 | 22 | # 0 scattering function 23 | # c1=M+1 24 | # c2=N 25 | 0 26 | 27 | 0 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test/1point-1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | #{M | } 6 | 1 3 7 | # M 1 8 | 1 0 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | #{i, j | i=2N; i=2j} 15 | 3 5 16 | # i j M 1 17 | 0 1 0 -2 0 18 | 0 1 -2 0 0 19 | 1 0 0 0 1 20 | 0 0 0 21 | 0 22 | 23 | 0 # Scattering functions 24 | -------------------------------------------------------------------------------- /test/basic-bounds-5.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 1 3 6 | # M 1 7 | 1 0 1 8 | 0 9 | 10 | 1 # Number of statements 11 | 12 | 1 13 | # {i,j,N | i=1; 2j-1<=N<=2j} 14 | 3 5 15 | # i j M 1 16 | 0 1 0 0 -1 17 | 1 0 2 -1 0 18 | 1 0 -2 1 1 19 | 0 0 0 20 | 0 21 | 22 | 0 # Scattering functions 23 | -------------------------------------------------------------------------------- /test/forwardsub-2-1-2-3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/forwardsub-2-1-2-3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | S3(1,0) ; 3 | for (k=2;k<=M;k++) { 4 | S1(1,1,k) ; 5 | } 6 | for (i=2;i<=M-1;i++) { 7 | S4(i,0) ; 8 | for (k=i+1;k<=M;k++) { 9 | S2(i,1,k) ; 10 | } 11 | } 12 | S4(M,0) ; 13 | -------------------------------------------------------------------------------- /test/reservoir/loechner3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/loechner3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if (M >= 1) { 3 | for (c2=1;c2<=M;c2++) { 4 | for (c4=2;c4<=c2+M;c4++) { 5 | for (c6=max(1,-c2+c4);c6<=min(M,c4-1);c6++) { 6 | S1(c2,c6,(c4-c6)); 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/reservoir/pingali4.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/pingali4.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | for (c2=1;c2<=M;c2++) { 3 | for (c4=1;c4<=M;c4++) { 4 | S1(c2,c4) ; 5 | } 6 | } 7 | for (c2=1;c2<=M;c2++) { 8 | for (c4=1;c4<=M;c4++) { 9 | S2(c2,c4) ; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/equality.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/equality.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | for (i0=0;i0<=5;i0++) { 3 | for (i1=ceild(4*i0,5);i1<=floord(6*i0+20,5);i1++) { 4 | if (2*i0 == i1) { 5 | S1(i0,i1) ; 6 | } 7 | if (i1 == 4) { 8 | S2(i0,i1) ; 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/min-2-1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/min-2-1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if ((M >= 0) && (N >= 1)) { 3 | for (i=1;i<=N;i++) { 4 | for (j=0;j<=min(min(M,i),-i+N);j++) { 5 | for (k=0;k<=min(min(M,i),-i+N);k++) { 6 | S1(i,j,k) ; 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/walters2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/walters2.cloog by CLooG 0.14.0-245-gd8c1718 gmp bits in 0.01s. */ 2 | for (i=0;i<=51;i++) { 3 | S2(0,i); 4 | } 5 | for (j=1;j<=24;j++) { 6 | S2(j,0); 7 | for (i=1;i<=50;i++) { 8 | S1(j,i); 9 | } 10 | S2(j,51); 11 | } 12 | for (i=0;i<=51;i++) { 13 | S2(25,i); 14 | } 15 | -------------------------------------------------------------------------------- /test/lex.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 2 4 | 5 | 0 6 | 7 | 2 8 | 9 | 1 10 | 2 3 11 | 1 1 0 12 | 1 -1 10 13 | 0 0 0 14 | 15 | 1 16 | 2 3 17 | 1 1 0 18 | 1 -1 10 19 | 0 0 0 20 | 21 | 0 22 | 23 | 2 24 | 25 | 3 6 26 | 0 -1 0 0 1 0 27 | 0 0 -1 0 0 0 28 | 0 0 0 -1 0 0 29 | 30 | 3 6 31 | 0 -1 0 0 1 0 32 | 0 0 -1 0 0 -1 33 | 0 0 0 -1 0 0 34 | 35 | 0 36 | -------------------------------------------------------------------------------- /test/isl/mod2.cloog: -------------------------------------------------------------------------------- 1 | # Language: C 2 | c 3 | 4 | # Context: 5 | 0 2 6 | 7 | 0 # Parameter name(s) 8 | # Statement number: 9 | 1 10 | 11 | # Iteration domain of statement 1 12 | { [i] : 0 <= i <= 3 and 0 <= i - 3*[i/3] <= 1 } 13 | 14 | 0 0 0 # For future options. 15 | 16 | 17 | 0 # Iterator name(s) 18 | 19 | # No scattering functions. 20 | 0 21 | -------------------------------------------------------------------------------- /test/lub.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/lub.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ 2 | if (M >= 2) { 3 | for (i=1;i<=M-1;i++) { 4 | for (j=i+1;j<=M;j++) { 5 | S1(i,j) ; 6 | for (k=i+1;k<=M;k++) { 7 | S2(i,j,k) ; 8 | S3(i,j,k) ; 9 | } 10 | S4(i,j) ; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/dot2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/dot2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | for (i=1;i<=min(M,N);i++) { 3 | S1(i) ; 4 | for (j=1;j<=M;j++) { 5 | S2(i,j) ; 6 | } 7 | } 8 | for (i=N+1;i<=M;i++) { 9 | S1(i) ; 10 | } 11 | for (i=M+1;i<=N;i++) { 12 | for (j=1;j<=M;j++) { 13 | S2(i,j) ; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/rational.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {} 5 | 0 2 6 | 0 7 | 8 | 1 # Number of statements: 9 | 10 | 1 11 | # {i, j | } 12 | 5 5 13 | # j q i 1 14 | 0 1 -1 0 -3 15 | 1 0 -5 1 -1 16 | 1 0 5 -1 4 17 | 1 0 0 1 0 18 | 1 0 0 -1 8 19 | 0 0 0 20 | 1 21 | j q i 22 | 23 | 0 # Scattering functions 24 | -------------------------------------------------------------------------------- /test/union.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../test/union.cloog by CLooG 0.19.0-6faa51a gmp bits in 0.00s. */ 2 | if (M <= -1) { 3 | for (c1=0;c1<=100;c1++) { 4 | S1(c1); 5 | } 6 | } 7 | if ((M >= 1) && (M <= 10)) { 8 | for (c1=0;c1<=100;c1++) { 9 | S1(c1); 10 | } 11 | } 12 | if (M >= 11) { 13 | for (c1=-100;c1<=0;c1++) { 14 | S1(-c1); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/non_optimal/nul_complex1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./non_optimal/nul_complex1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if (n >= 0) { 3 | for (c1=0;c1<=5*n;c1++) { 4 | for (c2=max(ceild(2*c1,3),c1-n);c2<=min(floord(2*c1+2*n,3),c1);c2++) { 5 | if (c2%2 == 0) { 6 | S1(((-2*c1+3*c2)/2),(c1-c2)); 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/multi-stride.cloog: -------------------------------------------------------------------------------- 1 | # Language 2 | c 3 | 4 | # Context 5 | 6 | 1 2 7 | 1 1 8 | 0 9 | 10 | # Number of statements 11 | 1 12 | 13 | 1 14 | 15 | # i' i j 1 16 | 4 5 17 | 0 1 -2 0 -1 18 | 0 1 0 -6 -2 19 | 1 1 0 0 0 20 | 1 -1 0 0 100 21 | 22 | 0 0 0 23 | 24 | 0 25 | 0 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /test/multi-stride2.cloog: -------------------------------------------------------------------------------- 1 | # Language 2 | c 3 | 4 | # Context 5 | 6 | 1 2 7 | 1 1 8 | 0 9 | 10 | # Number of statements 11 | 1 12 | 13 | 1 14 | 15 | # i' i j 1 16 | 4 5 17 | 0 1 -2 0 -1 18 | 0 1 0 -3 -2 19 | 1 1 0 0 0 20 | 1 -1 0 0 100 21 | 22 | 0 0 0 23 | 24 | 0 25 | 0 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /test/reservoir/lim-lam6.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/lim-lam6.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if (M >= 1) { 3 | for (c2=0;c2<=M;c2++) { 4 | for (c4=1;c4<=M;c4++) { 5 | S1(c2,c4) ; 6 | } 7 | } 8 | for (c2=0;c2<=M;c2++) { 9 | for (c4=1;c4<=M;c4++) { 10 | S2(c4,c2) ; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/reservoir/pingali2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/pingali2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.00s. */ 2 | if (M >= 1) { 3 | for (c2=1;c2<=M;c2++) { 4 | for (c4=1;c4<=M;c4++) { 5 | S1(c2,c4) ; 6 | } 7 | } 8 | for (c2=1;c2<=M;c2++) { 9 | for (c4=1;c4<=M;c4++) { 10 | S2(c2,c4) ; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/square+triangle-1-1-2-3.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/square+triangle-1-1-2-3.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.00s. */ 2 | for (j=1;j<=M;j++) { 3 | S1(1,j); 4 | } 5 | for (i=2;i<=M;i++) { 6 | S1(i,1); 7 | for (j=2;j<=i;j++) { 8 | S1(i,j); 9 | S2(i,j); 10 | } 11 | for (j=i+1;j<=M;j++) { 12 | S1(i,j); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/emploi.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/emploi.cloog by CLooG 0.14.0-245-gd8c1718 gmp bits in 0.01s. */ 2 | if (n >= 1) { 3 | if (m >= 1) { 4 | for (i=1;i<=n;i++) { 5 | S1(i); 6 | for (j=1;j<=m;j++) { 7 | S2(i,j); 8 | } 9 | } 10 | } 11 | if (m <= 0) { 12 | for (i=1;i<=n;i++) { 13 | S1(i); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/esced.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/esced.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if (m >= 1) { 3 | if (n >= 1) { 4 | for (i=1;i<=m;i++) { 5 | S1(i) ; 6 | for (j=1;j<=n;j++) { 7 | S2(i,j) ; 8 | } 9 | } 10 | } 11 | if (n <= 0) { 12 | for (i=1;i<=m;i++) { 13 | S1(i) ; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/ispdc.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {} 5 | 0 2 6 | 0 7 | 8 | 1 # Number of statements: 9 | 10 | 1 11 | # {i, j | 1<=i<=3 1<=j<=3} 12 | 4 4 13 | # i j 1 14 | 1 1 0 -1 15 | 1 -1 0 3 16 | 1 0 1 -1 17 | 1 0 -1 3 18 | 0 0 0 19 | 0 20 | 21 | 1 # Scattering functions 22 | 23 | 1 5 24 | # c1 j i 1 25 | 0 1 -1 -1 0 26 | 0 27 | -------------------------------------------------------------------------------- /test/min-3-1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 2 3 6 | # M 1 7 | 1 1 0 8 | 1 0 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | # 15 | 7 5 16 | # i j M 1 17 | 1 1 0 0 0 18 | 1 -1 0 1 0 19 | 1 -1 0 0 10 20 | 1 0 1 0 0 21 | 1 0 -1 1 0 22 | 1 0 -1 0 10 23 | 1 0 0 0 1 24 | 0 0 0 25 | 0 26 | 27 | 0 # Scattering functions 28 | -------------------------------------------------------------------------------- /test/nul_lcpc.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./nul_lcpc.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (i=1;i<=6;i+=2) { 3 | for (j=1;j<=i;j++) { 4 | S1(i,((i-1)/2),j); 5 | S2(i,((i-1)/2),j); 6 | } 7 | for (j=i+1;j<=p;j++) { 8 | S1(i,((i-1)/2),j); 9 | } 10 | } 11 | for (i=7;i<=m;i+=2) { 12 | for (j=1;j<=p;j++) { 13 | S1(i,((i-1)/2),j); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/reservoir/loechner4.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/loechner4.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if (M >= 1) { 3 | for (c2=2;c2<=2*M;c2++) { 4 | for (c4=1;c4<=M;c4++) { 5 | for (c6=1;c6<=M;c6++) { 6 | for (c8=max(1,c2-M);c8<=min(M,c2-1);c8++) { 7 | S1(c6,c4,c8,(c2-c8)); 8 | } 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/reservoir/loechner5.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/loechner5.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ 2 | if (M >= 1) { 3 | for (c2=1;c2<=M;c2++) { 4 | for (c4=1;c4<=M;c4++) { 5 | for (c6=1;c6<=M;c6++) { 6 | for (c8=1;c8<=M;c8++) { 7 | S1(c4,c6,c2,c8) ; 8 | } 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/lineality-2-1-2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./lineality-2-1-2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (i=1;i<=M;i++) { 3 | for (j=1;j<=min(M,i+1);j++) { 4 | S1(i,j); 5 | } 6 | if (i >= M-1) { 7 | S2(i,(i+2)); 8 | } 9 | if (i <= M-2) { 10 | S1(i,(i+2)); 11 | S2(i,(i+2)); 12 | } 13 | for (j=i+3;j<=M;j++) { 14 | S1(i,j); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/no_lindep.cloog: -------------------------------------------------------------------------------- 1 | # language C 2 | c 3 | 4 | # 2 parameters 5 | 1 4 6 | 1 0 0 0 7 | 8 | 0 9 | 10 | # 1 statement 11 | 1 12 | 13 | # 1 domain 14 | # i=n+2 15 | 1 16 | 1 5 17 | 0 -1 0 1 2 18 | 19 | 0 0 0 20 | 21 | 0 22 | 23 | # 1 scattering function 24 | # c1=M+1 25 | # c2=N 26 | 1 27 | 2 7 28 | 0 -1 0 0 1 0 1 29 | 0 0 -1 0 0 1 0 30 | 31 | 0 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /test/isl/mod.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | # Context: 4 | 0 2 5 | 6 | 0 # Parameter name(s) 7 | # Statement number: 8 | 1 9 | 10 | # Iteration domain of statement 1 11 | 4 4 1 0 1 0 12 | 1 1 0 0 13 | 1 -1 0 3 14 | 1 1 -3 0 15 | 1 -1 3 1 16 | 17 | 0 0 0 # For future options. 18 | 19 | 20 | 0 # Iterator name(s) 21 | 22 | # No scattering functions. 23 | 0 24 | -------------------------------------------------------------------------------- /test/isl/mod4.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 1 4 | 5 | 0 4 6 | 7 | 0 8 | 9 | 1 10 | 11 | 6 7 1 0 2 2 12 | 1 0 -5 0 0 1 0 13 | 1 0 5 0 0 -1 2 14 | 1 0 0 -11 1 0 0 15 | 1 0 0 11 -1 0 6 16 | 1 1 0 0 0 0 0 17 | 1 -1 0 0 1 1 0 18 | 19 | 0 0 0 20 | 21 | 0 22 | 23 | 0 24 | -------------------------------------------------------------------------------- /test/merge.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 2 4 | 5 | 0 6 | 7 | 3 8 | 9 | 1 10 | 1 3 11 | 0 -1 0 12 | 0 0 0 13 | 14 | 1 15 | 2 3 16 | 1 1 -2 17 | 1 -1 10 18 | 0 0 0 19 | 20 | 1 21 | 2 3 22 | 1 1 0 23 | 1 -1 10 24 | 0 0 0 25 | 26 | 0 27 | 28 | 3 29 | 30 | 2 5 31 | 0 1 0 -1 0 32 | 0 0 1 0 0 33 | 34 | 2 5 35 | 0 1 0 -1 0 36 | 0 0 1 0 -1 37 | 38 | 2 5 39 | 0 1 0 -1 0 40 | 0 0 1 0 -2 41 | 42 | 0 43 | -------------------------------------------------------------------------------- /include/cloog/isl/cloog.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOOG_ISL_H 2 | #define CLOOG_ISL_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #if defined(__cplusplus) 9 | extern "C" { 10 | #endif 11 | 12 | CloogState *cloog_isl_state_malloc(struct isl_ctx *ctx); 13 | 14 | #if defined(__cplusplus) 15 | } 16 | #endif 17 | 18 | #endif /* define _H */ 19 | -------------------------------------------------------------------------------- /test/min-4-1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | # {L,M,N|} 6 | 1 5 7 | # L M N 1 8 | 1 0 0 0 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | # {i|-L,-M <= i <= M, N} 15 | 5 6 16 | # i L M N 1 17 | 1 1 1 0 0 0 18 | 1 1 0 1 0 0 19 | 1 -1 0 1 0 0 20 | 1 -1 0 0 1 0 21 | 1 0 0 0 0 1 22 | 0 0 0 23 | 0 24 | 25 | 0 # Scattering functions 26 | -------------------------------------------------------------------------------- /test/constbound.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/constbound.cloog by CLooG 0.14.0-170-g72daac3 gmp bits in 0.01s. */ 2 | for (t0=0;t0<=199;t0++) { 3 | for (t2=50*t0;t2<=50*t0+24;t2++) { 4 | for (t3=0;t3<=t2;t3++) { 5 | S1(t0,t2,t3); 6 | } 7 | } 8 | for (t2=50*t0+25;t2<=50*t0+49;t2++) { 9 | for (t3=0;t3<=t2;t3++) { 10 | S2(t0,t2,t3); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/infinite3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/infinite3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.03s. */ 2 | for (;i<=0;i++) { 3 | S1(i) ; 4 | } 5 | for (i=1;i<=min(M,N);i++) { 6 | S1(i) ; 7 | for (j=1;j<=M;j++) { 8 | S2(i,j) ; 9 | } 10 | } 11 | for (i=N+1;i<=M;i++) { 12 | S1(i) ; 13 | } 14 | for (i=M+1;i<=N;i++) { 15 | for (j=1;j<=M;j++) { 16 | S2(i,j) ; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/wavefront.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 1 4 4 | # n m 1 5 | 1 0 0 1 6 | 1 7 | n m 8 | 9 | 1 10 | 11 | 1 12 | 4 6 13 | # i j n m 1 14 | 1 1 0 0 0 -1 15 | 1 -1 0 1 0 0 16 | 1 0 1 0 0 -1 17 | 1 0 -1 0 1 0 18 | 0 0 0 19 | 20 | 0 21 | 22 | 1 23 | 2 8 24 | # c1 c2 i j n m 1 25 | 0 1 0 -1 -1 0 0 0 26 | 0 0 1 -1 0 0 0 0 27 | 0 28 | -------------------------------------------------------------------------------- /test/ard.dat: -------------------------------------------------------------------------------- 1 | 9 13 2 | 0 1 0 0 0 0 0 0 0 0 0 0 0 3 | 0 0 0 1 0 0 0 0 0 -1 0 -1 0 4 | 0 0 0 0 1 0 0 -1 0 1 0 1 0 5 | 0 0 0 0 0 0 0 0 1 -1 0 0 0 6 | 0 0 0 0 0 0 0 0 0 0 1 -1 0 7 | 1 0 0 0 0 0 -1 0 0 0 0 0 0 8 | 1 0 0 0 0 -1 0 0 0 0 0 0 0 9 | 1 0 1 0 0 0 0 0 0 0 0 0 -1 10 | 1 0 0 0 0 0 0 0 0 0 0 0 1 11 | 12 | 0 2 13 | 14 | -------------------------------------------------------------------------------- /test/infinite.omega: -------------------------------------------------------------------------------- 1 | # CLooG -> OMEGA 2 | # This is an automatic dump of an input file from a CloogProgram data 3 | # structure. It can be correct ONLY if dumped before loop generation. 4 | 5 | # Context (2 parameter(s)). 6 | Symbolic M, N ; 7 | 8 | # Iteration domains: 9 | IS10:={[i]: 1>=0} ; 10 | IS20:={[i,j]: i-1>=0 && -i+N>=0 && j-1>=0 && -j+M>=0 && 1>=0} ; 11 | 12 | # CodeGen call: 13 | codegen 2 IS10, IS20 ; 14 | -------------------------------------------------------------------------------- /test/block.cloog: -------------------------------------------------------------------------------- 1 | c 2 | 3 | 0 2 4 | 5 | 0 6 | 7 | 3 8 | 9 | 1 10 | 0 2 11 | 12 | 0 0 0 13 | 14 | 1 15 | 0 2 16 | 17 | 0 0 0 18 | 19 | 1 20 | 2 3 21 | 1 1 0 22 | 1 -1 1 23 | 24 | 0 0 0 25 | 26 | 0 27 | 28 | 3 29 | 30 | 2 4 31 | 0 -1 0 0 # c1 = 0 32 | 0 0 -1 0 # c2 = 0 33 | 34 | 2 4 35 | 0 -1 0 1 # c1 = 1 36 | 0 0 -1 0 # c2 = 0 37 | 38 | 2 5 39 | 0 -1 0 1 0 # c1 = i 40 | 0 0 -1 0 1 # c2 = 1 41 | 42 | 0 43 | -------------------------------------------------------------------------------- /test/largeur.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters {n | n>= 0} 5 | 1 3 6 | 1 1 0 7 | 0 8 | 9 | 1 # Number of statements 10 | 11 | 1 12 | # {i, j | 1<=i<=n i<=j<=n} 13 | 4 5 14 | 1 1 0 0 -1 15 | 1 -1 0 1 0 16 | 1 -1 1 0 0 17 | 1 0 -1 1 0 18 | 0 0 0 19 | 0 20 | 21 | 1 # Scattering functions 22 | # Et les instructions de chunking... 23 | 2 7 24 | 0 1 0 0 -1 0 0 25 | 0 0 1 -1 0 0 0 26 | 0 27 | -------------------------------------------------------------------------------- /test/nul_basic1.cloog: -------------------------------------------------------------------------------- 1 | # Optimal code is in fact : 2 | # 3 | # for (i=0;i<=M;i+=2) { 4 | # S1 ; 5 | # } 6 | 7 | # language: C 8 | c 9 | 10 | # parameter n 11 | 1 3 12 | # n 1 13 | 1 0 1 14 | 0 15 | 16 | 1 # Number of statements 17 | 18 | 1 19 | # {i, j | i=2*j; 0<=i<=n} 20 | 3 5 21 | # i j n 1 22 | 0 1 -2 0 0 23 | 1 1 0 0 0 24 | 1 -1 0 1 0 25 | 0 0 0 26 | 0 27 | 28 | 0 # Scattering functions 29 | -------------------------------------------------------------------------------- /test/ex1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/ex1.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | for (i=0;i<=14;i++) { 3 | for (j=0;j<=n-15;j++) { 4 | S1(i,j) ; 5 | } 6 | } 7 | for (i=15;i<=n;i++) { 8 | for (j=0;j<=9;j++) { 9 | S1(i,j) ; 10 | } 11 | for (j=10;j<=n-15;j++) { 12 | S1(i,j) ; 13 | S2(i,j) ; 14 | } 15 | for (j=n-14;j<=n;j++) { 16 | S2(i,j) ; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/4-param.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/4-param.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.18s. */ 2 | for (i=m;i<=min(n,p-1);i++) { 3 | S1(i) ; 4 | } 5 | for (i=p;i<=min(q,m-1);i++) { 6 | S2(i) ; 7 | } 8 | for (i=max(m,p);i<=min(n,q);i++) { 9 | S1(i) ; 10 | S2(i) ; 11 | } 12 | for (i=max(max(m,p),q+1);i<=n;i++) { 13 | S1(i) ; 14 | } 15 | for (i=max(max(m,p),n+1);i<=q;i++) { 16 | S2(i) ; 17 | } 18 | -------------------------------------------------------------------------------- /test/reservoir/pingali3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/pingali3.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if (M >= 1) { 3 | for (c2=1;c2<=M;c2++) { 4 | for (c4=1;c4<=M;c4++) { 5 | S1(c2,c4) ; 6 | } 7 | } 8 | for (c2=1;c2<=M;c2++) { 9 | for (c4=1;c4<=M;c4++) { 10 | for (c6=1;c6<=M;c6++) { 11 | S2(c2,c4,c6) ; 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/christian.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./christian.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if (N >= 1) { 3 | S1(0,(N-1)); 4 | for (p=-N+2;p<=N-1;p++) { 5 | if (p >= 1) { 6 | S2((p-1),0); 7 | } 8 | for (i=max(0,p);i<=min(N-1,p+N-2);i++) { 9 | S1(i,(-p+i)); 10 | S2(i,(-p+i+1)); 11 | } 12 | if (p <= 0) { 13 | S1((p+N-1),(N-1)); 14 | } 15 | } 16 | S2((N-1),0); 17 | } 18 | -------------------------------------------------------------------------------- /test/constant.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/constant.cloog by CLooG 0.14.0-333-g4442dac gmp bits in 0.01s. */ 2 | for (c2=0;c2<=min(1023,M+1024);c2++) { 3 | S1(c2); 4 | S3(c2); 5 | } 6 | for (c2=max(0,M+1025);c2<=1023;c2++) { 7 | S2(c2); 8 | S3(c2); 9 | } 10 | for (c1=0;c1<=min(1023,M+1024);c1++) { 11 | S4(c1); 12 | S6(c1); 13 | } 14 | for (c1=max(0,M+1025);c1<=1023;c1++) { 15 | S5(c1); 16 | S6(c1); 17 | } 18 | -------------------------------------------------------------------------------- /test/openscop/coordinates.c: -------------------------------------------------------------------------------- 1 | /* Useful macros. */ 2 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 3 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 4 | #define max(x,y) ((x) > (y) ? (x) : (y)) 5 | #define min(x,y) ((x) < (y) ? (x) : (y)) 6 | 7 | #ifdef TIME 8 | #define IF_TIME(foo) foo; 9 | #else 10 | #define IF_TIME(foo) 11 | #endif 12 | 13 | 14 | for (i=0;i<=41;i++) { 15 | S1(i); 16 | } 17 | -------------------------------------------------------------------------------- /test/reservoir/fusion2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/fusion2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if ((M >= 1) && (N >= 1)) { 3 | for (c4=1;c4<=M;c4++) { 4 | S1(1,c4); 5 | } 6 | for (c2=2;c2<=N;c2++) { 7 | for (c4=1;c4<=M;c4++) { 8 | S2((c2-1),c4); 9 | } 10 | for (c4=1;c4<=M;c4++) { 11 | S1(c2,c4); 12 | } 13 | } 14 | for (c4=1;c4<=M;c4++) { 15 | S2(N,c4); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/reservoir/two.cloog: -------------------------------------------------------------------------------- 1 | # Scan 2 | # D = { (i, j, k) | 0 <= i < 10, 1 <= j < 20, 2i + 3j = k, i + j + 3 = 3k } 3 | # 4 | # language: C 5 | c 6 | 7 | # parameter (none) 8 | 1 2 9 | 1 1 10 | 0 11 | 12 | 1 # Number of statements 13 | 14 | 1 15 | 6 5 16 | # i j k 1 17 | 1 1 0 0 0 18 | 1 -1 0 0 10 19 | 1 0 1 0 -1 20 | 1 0 -1 0 20 21 | 0 2 3 -1 0 22 | 0 1 1 -1 3 23 | 0 0 0 24 | 0 25 | 26 | 0 # Scattering functions 27 | -------------------------------------------------------------------------------- /test/dot2.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters {M, N | M>=1 N >=1} 5 | 2 4 6 | 1 1 0 -1 7 | 1 0 1 -1 8 | 0 9 | 10 | 2 # Number of statements 11 | 12 | 1 13 | # {i | 1<=i<=M} 14 | 2 5 15 | 1 1 0 0 -1 16 | 1 -1 1 0 0 17 | 0 0 0 18 | 19 | 1 20 | # {i, j | 1<=i<=N 1<=j<=M} 21 | 4 6 22 | 1 1 0 0 0 -1 23 | 1 -1 0 0 1 0 24 | 1 0 1 0 0 -1 25 | 1 0 -1 1 0 0 26 | 0 0 0 27 | 0 28 | 29 | 0 # Scattering functions 30 | -------------------------------------------------------------------------------- /test/esced.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters {n, m | n<=m} 5 | 1 4 6 | #1 1 -1 0 7 | 1 0 0 1 8 | 1 9 | n m 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i | 1<=i<=n} 15 | 2 5 16 | 1 1 0 0 -1 17 | 1 -1 0 1 0 18 | 0 0 0 19 | 20 | 1 21 | # {i, j | 1<=i<=n 1<=j<=m} 22 | 4 6 23 | 1 1 0 0 0 -1 24 | 1 -1 0 0 1 0 25 | 1 0 1 0 0 -1 26 | 1 0 -1 1 0 0 27 | 0 0 0 28 | 0 29 | 30 | 0 # Scattering functions 31 | -------------------------------------------------------------------------------- /test/rectangle.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {n | n>= 0} 5 | 1 3 6 | # n 1 7 | 1 1 0 8 | 1 9 | n 10 | 11 | 1 # Number of statements: 12 | 13 | 1 14 | # {ii, i | 0<=i<=n 0<=j<=n} 15 | 4 5 16 | # i j n 1 17 | 1 1 0 0 0 18 | 1 -1 0 1 0 19 | 1 0 1 0 0 20 | 1 0 -1 1 0 21 | 0 0 0 22 | 0 23 | 24 | 1 # Scattering functions 25 | 26 | 1 6 27 | # c1 j i n 1 28 | 0 1 -1 -1 0 0 29 | 0 30 | -------------------------------------------------------------------------------- /test/reservoir/lim-lam2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/lim-lam2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | for (c2=1;c2<=M;c2++) { 3 | S1(c2) ; 4 | } 5 | if (N >= 2) { 6 | for (c2=1;c2<=M;c2++) { 7 | for (c4=2;c4<=N;c4++) { 8 | S2(c2,c4) ; 9 | } 10 | } 11 | } 12 | if (N >= 2) { 13 | for (c2=1;c2<=M;c2++) { 14 | for (c4=1;c4<=N-1;c4++) { 15 | S3(c2,c4) ; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /genversion.sh.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | srcdir=@abs_srcdir@ 3 | PACKAGE=@PACKAGE@ 4 | VERSION=@VERSION@ 5 | 6 | if test -f $srcdir/.git/HEAD; then 7 | GIT_REPO="$srcdir/.git" 8 | GIT_HEAD_ID="$PACKAGE-$VERSION-`GIT_DIR=$GIT_REPO git rev-parse --short HEAD`" 9 | elif test -f $srcdir/CLOOG_HEAD; then 10 | GIT_HEAD_ID=`cat $srcdir/CLOOG_HEAD` 11 | else 12 | GIT_HEAD_ID="$PACKAGE-$VERSION-UNKNOWN" 13 | fi 14 | 15 | echo $GIT_HEAD_ID | sed -e 's/cloog-//' 16 | -------------------------------------------------------------------------------- /source/mp_get_memory_functions.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void mp_get_memory_functions( 4 | void *(**alloc_func_ptr) (size_t), 5 | void *(**realloc_func_ptr) (void *, size_t, size_t), 6 | void (**free_func_ptr) (void *, size_t)) 7 | { 8 | if (alloc_func_ptr) 9 | *alloc_func_ptr = __gmp_allocate_func; 10 | if (realloc_func_ptr) 11 | *realloc_func_ptr = __gmp_reallocate_func; 12 | if (free_func_ptr) 13 | *free_func_ptr = __gmp_free_func; 14 | } 15 | -------------------------------------------------------------------------------- /test/logo.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/logo.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.01s. */ 2 | for (j=0;j<=7;j++) { 3 | S1(1,j); 4 | } 5 | for (i=2;i<=6;i++) { 6 | for (j=0;j<=i-2;j++) { 7 | S2(i,j); 8 | } 9 | for (j=i-1;j<=4;j++) { 10 | S1(i,j); 11 | S2(i,j); 12 | } 13 | for (j=5;j<=7;j++) { 14 | S1(i,j); 15 | } 16 | } 17 | for (i=7;i<=8;i++) { 18 | for (j=i-1;j<=7;j++) { 19 | S1(i,j); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/openscop/empty.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./openscop/empty.scop by CLooG 0.18.3 gmp bits in 0.00s. */ 2 | /* Useful macros. */ 3 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 4 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 5 | #define max(x,y) ((x) > (y) ? (x) : (y)) 6 | #define min(x,y) ((x) < (y) ? (x) : (y)) 7 | 8 | #ifdef TIME 9 | #define IF_TIME(foo) foo; 10 | #else 11 | #define IF_TIME(foo) 12 | #endif 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/published/CC2003/esced.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters {n, m | n<=m} 5 | 1 4 6 | #1 1 -1 0 7 | 1 0 0 1 8 | 1 9 | n m 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i | 1<=i<=n} 15 | 2 5 16 | 1 1 0 0 -1 17 | 1 -1 0 1 0 18 | 0 0 0 19 | 20 | 1 21 | # {i, j | 1<=i<=n 1<=j<=m} 22 | 4 6 23 | 1 1 0 0 0 -1 24 | 1 -1 0 0 1 0 25 | 1 0 1 0 0 -1 26 | 1 0 -1 1 0 0 27 | 0 0 0 28 | 0 29 | 30 | 0 # Scattering functions 31 | -------------------------------------------------------------------------------- /test/test.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/test.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.01s. */ 2 | for (i=1;i<=2;i++) { 3 | for (j=1;j<=M;j++) { 4 | S1(i,j); 5 | } 6 | } 7 | for (i=3;i<=N;i++) { 8 | for (j=1;j<=min(M,i-1);j++) { 9 | S1(i,j); 10 | } 11 | if (i >= M+1) { 12 | S2(i,i); 13 | } 14 | if (i <= M) { 15 | S1(i,i); 16 | S2(i,i); 17 | } 18 | for (j=i+1;j<=M;j++) { 19 | S1(i,j); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/gesced.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./gesced.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (c1=1;c1<=N;c1++) { 3 | S1(c1); 4 | } 5 | for (c1=N+1;c1<=2*N;c1++) { 6 | for (i=1;i<=N;i++) { 7 | S2(i,(c1-N)); 8 | } 9 | } 10 | for (c1=2*N+1;c1<=M+N;c1++) { 11 | for (i=1;i<=N;i++) { 12 | S3(i,(c1-2*N)); 13 | S2(i,(c1-N)); 14 | } 15 | } 16 | for (c1=M+N+1;c1<=M+2*N;c1++) { 17 | for (i=1;i<=N;i++) { 18 | S3(i,(c1-2*N)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/tiling.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {n | n>= 0} 5 | 1 3 6 | # n 1 7 | 1 1 0 8 | 1 9 | n 10 | 11 | 1 # Number of statements: 12 | 13 | 1 14 | # {ii, i | t*ii<=i<=t*ii+t-1 0<=i<=n} 15 | 4 5 16 | # ii i n 1 17 | 1 0 1 0 0 18 | 1 0 -1 1 0 19 | 1 10 -1 0 9 20 | 1 -10 1 0 0 21 | 0 0 0 22 | 1 23 | ii i 24 | 25 | 0 # Scattering functions 26 | 27 | 1 6 28 | # c1 ii i n 1 29 | 0 1 -1 -2 0 0 30 | 0 31 | -------------------------------------------------------------------------------- /test/gauss.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/gauss.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.03s. */ 2 | if (M >= 2) { 3 | for (c2=2;c2<=M;c2++) { 4 | for (j=2;j<=M;j++) { 5 | S2(1,j,c2) ; 6 | } 7 | } 8 | for (c1=2;c1<=M-1;c1++) { 9 | for (c2=c1+1;c2<=M;c2++) { 10 | for (j=1;j<=c1-1;j++) { 11 | S1(c1,j,c2) ; 12 | } 13 | for (j=c1+1;j<=M;j++) { 14 | S2(c1,j,c2) ; 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/logo.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 1 3 6 | # n 1 7 | 1 0 1 8 | 0 9 | 10 | 2 # Number of statements 11 | 12 | 1 13 | 3 5 14 | # i j n 1 15 | 1 1 0 0 -1 # i >= 1 16 | 1 0 -1 0 7 # j <= 7 17 | 1 -1 1 0 1 # j >= i-1 18 | 0 0 0 19 | 20 | 1 21 | 4 5 22 | # i j n 1 23 | 1 1 0 0 -2 # i >= 2 24 | 1 -1 0 0 6 # i <= 6 25 | 1 0 1 0 0 # j >= 0 26 | 1 0 -1 0 4 # j <= 4 27 | 0 0 0 28 | 0 29 | 30 | 0 # Scattering functions 31 | -------------------------------------------------------------------------------- /test/min-1-1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | # {M,N | 1>=0} 6 | 1 4 7 | # M N 1 8 | 1 0 0 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | # {i,j |1<=i<=N; 0<=j<=M; j<=i; j+i<=N}, i.e. 15 | # {i,j | (1,j)<=i<=-j+N; 0<=j<=M} 16 | 6 6 17 | # i j M N 1 18 | 1 1 0 0 0 -1 19 | 1 0 1 0 0 0 20 | 1 0 -1 1 0 0 21 | 1 1 -1 0 0 0 22 | 1 -1 -1 0 1 0 23 | 1 0 0 0 0 1 24 | 0 0 0 25 | 0 26 | 27 | 0 # Scattering functions 28 | -------------------------------------------------------------------------------- /test/logopar.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/logopar.cloog by CLooG 0.14.0-284-g5c046c9 gmp bits in 0.00s. */ 2 | for (j=0;j<=m;j++) { 3 | S1(1,j); 4 | } 5 | for (i=2;i<=n;i++) { 6 | for (j=0;j<=i-2;j++) { 7 | S2(i,j); 8 | } 9 | for (j=i-1;j<=n;j++) { 10 | S1(i,j); 11 | S2(i,j); 12 | } 13 | for (j=n+1;j<=m;j++) { 14 | S1(i,j); 15 | } 16 | } 17 | for (i=n+1;i<=m+1;i++) { 18 | for (j=i-1;j<=m;j++) { 19 | S1(i,j); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/reservoir/lim-lam5.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/lim-lam5.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if (M >= 1) { 3 | for (c2=1;c2<=M;c2++) { 4 | for (c4=1;c4<=M;c4++) { 5 | S1(c2,c4) ; 6 | } 7 | } 8 | for (c2=1;c2<=M;c2++) { 9 | for (c4=1;c4<=M;c4++) { 10 | S2(c2,c4) ; 11 | } 12 | } 13 | for (c2=1;c2<=M;c2++) { 14 | for (c4=1;c4<=M;c4++) { 15 | S3(c2,c4) ; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/yosrf.f: -------------------------------------------------------------------------------- 1 | ! Generated from ../../../git/cloog/test/yosrf.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. 2 | IF (n >= 2) THEN 3 | DO j=2, n 4 | S1(1,j) 5 | END DO 6 | DO proc=2, n-1 7 | DO i=1, proc-1 8 | DO j=i+1, n 9 | S2(i,j,proc) 10 | END DO 11 | END DO 12 | DO j=proc+1, n 13 | S1(proc,j) 14 | END DO 15 | END DO 16 | DO i=1, n-1 17 | DO j=i+1, n 18 | S2(i,j,n) 19 | END DO 20 | END DO 21 | END IF 22 | -------------------------------------------------------------------------------- /doc/images/tree.txt: -------------------------------------------------------------------------------- 1 | * 2 | | 3 | |0 4 | | 5 | V 6 | i 7 | | 8 | +-----+-----+ 9 | | | | 10 | |0 |1 |2 11 | | | | 12 | V V V 13 | j S2 j 14 | | | 15 | |0 +--+--+ 16 | | | | 17 | V |0 |1 18 | S1 | | 19 | V V 20 | k S4 21 | | 22 | |0 23 | | 24 | V 25 | S3 26 | -------------------------------------------------------------------------------- /source/version.c.in: -------------------------------------------------------------------------------- 1 | #include "version.h" 2 | #include "cloog/version.h" 3 | 4 | #define CLOOG_BITS "@BITS@" 5 | 6 | const char *cloog_version(void) 7 | { 8 | return "CLooG "CLOOG_HEAD" "CLOOG_BITS" bits"; 9 | } 10 | 11 | int cloog_version_major(void) 12 | { 13 | return CLOOG_VERSION_MAJOR; 14 | } 15 | 16 | int cloog_version_minor(void) 17 | { 18 | return CLOOG_VERSION_MINOR; 19 | } 20 | 21 | int cloog_version_revision(void) 22 | { 23 | return CLOOG_VERSION_REVISION; 24 | } 25 | -------------------------------------------------------------------------------- /test/0D-1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/0D-1.cloog by CLooG 0.14.0-117-g5444fca gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1() { hash(1); } 11 | 12 | void test() 13 | { 14 | S1() ; 15 | } 16 | -------------------------------------------------------------------------------- /test/0D-3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/0D-3.cloog by CLooG 0.14.0-117-g5444fca gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1() { hash(1); } 11 | 12 | void test(int M) 13 | { 14 | S1() ; 15 | } 16 | -------------------------------------------------------------------------------- /test/infinite.cloog: -------------------------------------------------------------------------------- 1 | # langage 2 | c 3 | 4 | # parametres {M, N | M>=1 N >=1} 5 | 2 4 6 | # M N 1 7 | 1 1 0 -1 8 | 1 0 1 -1 9 | 0 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i | 1<=i<=M} 15 | 0 5 16 | # i M N 1 17 | #1 1 0 0 -1 18 | #1 -1 1 0 0 19 | 0 0 0 20 | 21 | 1 22 | # {i, j | 1<=i<=N 1<=j<=M} 23 | 4 6 24 | # i j M N 1 25 | 1 1 0 0 0 -1 26 | 1 -1 0 0 1 0 27 | 1 0 1 0 0 -1 28 | 1 0 -1 1 0 0 29 | 0 0 0 30 | 0 31 | 32 | 0 # Scattering functions 33 | -------------------------------------------------------------------------------- /test/infinite2.cloog: -------------------------------------------------------------------------------- 1 | # langage 2 | c 3 | 4 | # parametres {M, N | M>=1 N >=1} 5 | 2 4 6 | # M N 1 7 | 1 1 0 -1 8 | 1 0 1 -1 9 | 0 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i | 1<=i<=M} 15 | 1 5 16 | # i M N 1 17 | 1 1 0 0 -1 18 | #1 -1 1 0 0 19 | 0 0 0 20 | 21 | 1 22 | # {i, j | 1<=i<=N 1<=j<=M} 23 | 4 6 24 | # i j M N 1 25 | 1 1 0 0 0 -1 26 | 1 -1 0 0 1 0 27 | 1 0 1 0 0 -1 28 | 1 0 -1 1 0 0 29 | 0 0 0 30 | 0 31 | 32 | 0 # Scattering functions 33 | -------------------------------------------------------------------------------- /test/infinite3.cloog: -------------------------------------------------------------------------------- 1 | # langage 2 | c 3 | 4 | # parametres {M, N | M>=1 N >=1} 5 | 2 4 6 | # M N 1 7 | 1 1 0 -1 8 | 1 0 1 -1 9 | 0 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i | 1<=i<=M} 15 | 1 5 16 | # i M N 1 17 | #1 1 0 0 -1 18 | 1 -1 1 0 0 19 | 0 0 0 20 | 21 | 1 22 | # {i, j | 1<=i<=N 1<=j<=M} 23 | 4 6 24 | # i j M N 1 25 | 1 1 0 0 0 -1 26 | 1 -1 0 0 1 0 27 | 1 0 1 0 0 -1 28 | 1 0 -1 1 0 0 29 | 0 0 0 30 | 0 31 | 32 | 0 # Scattering functions 33 | -------------------------------------------------------------------------------- /test/dealII.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../test/dealII.cloog by CLooG 0.19.0-6faa51a gmp bits in 0.01s. */ 2 | for (scat_0=0;scat_0<=min(T_66,T_2-1);scat_0++) { 3 | S1(scat_0); 4 | S2(scat_0); 5 | } 6 | for (scat_0=max(0,T_66+1);scat_0<=T_2-1;scat_0++) { 7 | S1(scat_0); 8 | } 9 | if ((T_2 == 0) && (T_66 <= -1) && (T_67 == 0)) { 10 | S1(0); 11 | } 12 | if ((T_2 == 0) && (T_66 >= 0) && (T_67 == 0)) { 13 | S1(0); 14 | } 15 | for (scat_0=T_2;scat_0<=min(T_66,T_67-1);scat_0++) { 16 | S2(scat_0); 17 | } 18 | -------------------------------------------------------------------------------- /test/4-param.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | # parameters m n p q 6 | 1 6 7 | # m n p q 1 8 | 1 0 0 0 0 1 9 | 1 10 | m n p q 11 | 12 | 2 # Number of statements 13 | 14 | 1 15 | # S1 i,... 16 | 3 7 17 | # i m n p q 1 18 | 1 1 -1 0 0 0 0 19 | 1 -1 0 1 0 0 0 20 | 1 0 0 0 0 0 1 21 | 0 0 0 22 | 23 | 1 24 | # 25 | 3 7 26 | # i m n p q 1 27 | 1 1 0 0 -1 0 0 28 | 1 -1 0 0 0 1 0 29 | 1 0 0 0 0 0 1 30 | 0 0 0 31 | 0 32 | 33 | 0 # Scattering functions 34 | -------------------------------------------------------------------------------- /test/ex1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters {n} 5 | 1 3 6 | # n 1 7 | 1 1 -25 8 | 1 9 | n 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i | 0<=i<=n, 0<=j<=n-15} 15 | 4 5 16 | # i j n 1 17 | 1 1 0 0 0 18 | 1 -1 0 1 0 19 | 1 0 1 0 0 20 | 1 0 -1 1 -15 21 | 0 0 0 22 | 23 | 1 24 | # {i | 15<=i<=n, 10<=j<=n} 25 | 4 5 26 | # i j n 1 27 | 1 1 0 0 -15 28 | 1 -1 0 1 0 29 | 1 0 1 0 -10 30 | 1 0 -1 1 0 31 | 0 0 0 32 | 0 33 | 34 | 0 # Scattering functions 35 | -------------------------------------------------------------------------------- /test/forwardsub-3-1-2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./forwardsub-3-1-2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | S3(2,1); 3 | S1(3,1); 4 | S1(4,1); 5 | S4(4,2); 6 | for (i=5;i<=M+1;i++) { 7 | S1(i,1); 8 | for (j=2;j<=floord(i-1,2);j++) { 9 | S2(i,j); 10 | } 11 | if (i%2 == 0) { 12 | S4(i,(i/2)); 13 | } 14 | } 15 | for (i=M+2;i<=2*M-1;i++) { 16 | for (j=i-M;j<=floord(i-1,2);j++) { 17 | S2(i,j); 18 | } 19 | if (i%2 == 0) { 20 | S4(i,(i/2)); 21 | } 22 | } 23 | S4(2*M,M); 24 | -------------------------------------------------------------------------------- /test/byu98-1-2-3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./byu98-1-2-3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | for (i=2;i<=3;i++) { 3 | for (j=-i+6;j<=6;j++) { 4 | S1(i,j); 5 | } 6 | } 7 | for (i=4;i<=7;i++) { 8 | if (i == 4) { 9 | for (j=3;j<=4;j++) { 10 | S1(i,j); 11 | } 12 | } 13 | if (i >= 6) { 14 | S2(i,(-i+9)); 15 | } 16 | if (i <= 5) { 17 | S1(i,(-i+9)); 18 | S2(i,(-i+9)); 19 | } 20 | for (j=max(-i+10,i-1);j<=6;j++) { 21 | S1(i,j); 22 | } 23 | } 24 | S2(8,1); 25 | -------------------------------------------------------------------------------- /test/diagonal.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {n | n>= 0} 5 | 0 3 6 | 1 7 | n m 8 | 9 | 2 # Number of statements: 10 | 11 | 1 12 | # {i, j | 1<=i<=n 1<=j<=n} 13 | 4 5 14 | # i j n 1 15 | 1 1 0 0 -1 16 | 1 -1 0 1 0 17 | 1 0 1 0 -1 18 | 1 0 -1 1 0 19 | 0 0 0 20 | 21 | 1 22 | # {i, j | i=j 1<=j<=n} 23 | 3 5 24 | # i j n 1 25 | 0 1 -1 0 0 26 | 1 0 1 0 -1 27 | 1 0 -1 1 0 28 | 0 0 0 29 | 0 30 | 31 | 0 # Scattering functions 32 | -------------------------------------------------------------------------------- /test/equality.cloog: -------------------------------------------------------------------------------- 1 | # Language: C 2 | c 3 | 4 | # Context (0 parameter(s)): 5 | 1 2 6 | 1 1 7 | 1 # Parameter name(s) 8 | 9 | 10 | # Statement number: 11 | 2 12 | 13 | # Iteration domain of statement 1. 14 | 1 15 | 3 4 16 | 0 2 -1 0 17 | 1 1 0 0 18 | 1 -1 0 5 19 | 0 0 0 # For future options. 20 | 21 | # Iteration domain of statement 2. 22 | 1 23 | 3 4 24 | 0 0 -1 4 25 | 1 1 0 0 26 | 1 -1 0 5 27 | 0 0 0 # For future options. 28 | 29 | 1 # Iterator name(s) 30 | i0 i1 31 | 32 | # No scattering functions. 33 | 0 34 | -------------------------------------------------------------------------------- /test/lu.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/lu.cloog by CLooG 0.14.0-238-gb1cb779 gmp bits in 0.01s. */ 2 | if (n >= 2) { 3 | for (j=2;j<=n;j++) { 4 | S1(1,j); 5 | } 6 | for (c1=2;c1<=n-1;c1++) { 7 | for (c2=2;c2<=n;c2++) { 8 | for (i=1;i<=min(c1-1,c2-1);i++) { 9 | S2(i,c2,c1); 10 | } 11 | } 12 | for (j=c1+1;j<=n;j++) { 13 | S1(c1,j); 14 | } 15 | } 16 | for (c2=2;c2<=n;c2++) { 17 | for (i=1;i<=c2-1;i++) { 18 | S2(i,c2,n); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/lu2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/lu2.cloog by CLooG 0.14.0-238-gb1cb779 gmp bits in 0.01s. */ 2 | if (n >= 2) { 3 | for (l=2;l<=n;l++) { 4 | S1(1,n,1,l); 5 | } 6 | for (i=2;i<=n-1;i++) { 7 | for (j=2;j<=n;j++) { 8 | for (k=1;k<=min(i-1,j-1);k++) { 9 | S2(i,j,k,j,i); 10 | } 11 | } 12 | for (l=i+1;l<=n;l++) { 13 | S1(i,n,i,l); 14 | } 15 | } 16 | for (j=2;j<=n;j++) { 17 | for (k=1;k<=j-1;k++) { 18 | S2(n,j,k,j,n); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/lux.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/lux.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ 2 | if (M >= 2) { 3 | for (l=2;l<=M;l++) { 4 | S1(1,1,M,l) ; 5 | } 6 | for (i=2;i<=M-1;i++) { 7 | for (j=1;j<=i-1;j++) { 8 | for (k=j+1;k<=M;k++) { 9 | S2(i,j,k,k,i) ; 10 | } 11 | } 12 | for (l=i+1;l<=M;l++) { 13 | S1(i,i,M,l) ; 14 | } 15 | } 16 | for (j=1;j<=M-1;j++) { 17 | for (k=j+1;k<=M;k++) { 18 | S2(M,j,k,k,M) ; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/0D-2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/0D-2.cloog by CLooG 0.14.0-117-g5444fca gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1() { hash(1); } 11 | 12 | void test(int M) 13 | { 14 | if (M >= 0) { 15 | S1() ; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/durbin_e_s.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./durbin_e_s.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | S4(1,0,0); 3 | S7(1,0,0); 4 | S8(1,0,3); 5 | for (i=2;i<=9;i++) { 6 | S2(i,-7,0); 7 | for (j=-7;j<=i-9;j++) { 8 | S3(i,j,1); 9 | } 10 | S6(i,(i-9),2); 11 | S8(i,0,3); 12 | for (j=1;j<=i-1;j++) { 13 | S5(i,j,3); 14 | } 15 | } 16 | S2(10,-7,0); 17 | for (j=-7;j<=1;j++) { 18 | S3(10,j,1); 19 | } 20 | S6(10,1,2); 21 | for (j=1;j<=9;j++) { 22 | S5(10,j,3); 23 | S1(10,j,4); 24 | } 25 | S1(10,10,4); 26 | -------------------------------------------------------------------------------- /test/yosr.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/yosr.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.01s. */ 2 | if (n >= 2) { 3 | for (j=2;j<=n;j++) { 4 | S1(1,j) ; 5 | } 6 | for (proc=2;proc<=n-1;proc++) { 7 | for (i=1;i<=proc-1;i++) { 8 | for (j=i+1;j<=n;j++) { 9 | S2(i,j,proc) ; 10 | } 11 | } 12 | for (j=proc+1;j<=n;j++) { 13 | S1(proc,j) ; 14 | } 15 | } 16 | for (i=1;i<=n-1;i++) { 17 | for (j=i+1;j<=n;j++) { 18 | S2(i,j,n) ; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/reservoir/tang-xue1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../test/reservoir/tang-xue1.cloog by CLooG 0.18.4-dac762f gmp bits in 0.01s. */ 2 | for (c2=0;c2<=9;c2++) { 3 | for (c4=max(-1,c2-9);c4<=min(4,c2+3);c4++) { 4 | for (c6=max(max(1,c2),c2-c4);c6<=min(min(9,c2+1),c2-c4+4);c6++) { 5 | for (c8=max(1,-c2+c4+c6);c8<=min(4,-c2+c4+c6+1);c8++) { 6 | if (c2%2 == 0) { 7 | if ((c2+c4)%2 == 0) { 8 | S1((c2/2),((-c2+c4)/2),(-c2+c6),(-c4+c8)); 9 | } 10 | } 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/isl/jacobi-shared.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../test/isl/jacobi-shared.cloog by CLooG 0.19.0-6faa51a gmp bits in 0.26s. */ 2 | if ((h0+1)%2 == 0) { 3 | if ((16*floord(N-t0-1,16) >= -t0+3) && (16*floord(N-t0-1,16) >= g1-t0+1) && (32*floord(t1-1,32) <= g2+t1-3) && (32*floord(t1-1,32) >= -N+g2+t1+1)) { 4 | for (c0=max(-16*floord(t0-1,16)+t0,-16*floord(g1+t0-3,16)+t0);c0<=min(32,N-g1-1);c0+=16) { 5 | for (c1=-32*floord(t1-1,32)+t1;c1<=min(32,N-g2-1);c1+=32) { 6 | S1((c0+g1-1),(c1+g2-1)); 7 | } 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/test.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters {m, n | 4<=m<=n} 5 | 2 4 6 | # m n 1 7 | 1 -1 1 0 8 | 1 1 0 -4 9 | 0 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i, j | 1<=i<=n 1<=j<=m} 15 | 4 6 16 | # i j m n 1 17 | 1 1 0 0 0 -1 18 | 1 -1 0 0 1 0 19 | 1 0 1 0 0 -1 20 | 1 0 -1 1 0 0 21 | 0 0 0 22 | 23 | 1 24 | # {i, j | i=j 3<=j<=N} 25 | 3 6 26 | # i j m n 1 27 | 0 1 -1 0 0 0 28 | 1 0 1 0 0 -3 29 | 1 0 -1 0 1 0 30 | 0 0 0 31 | 0 32 | 33 | 0 # Scattering functions 34 | -------------------------------------------------------------------------------- /test/mode.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters n m 5 | 1 4 6 | # n m 1 7 | 1 0 0 1 8 | 0 9 | 10 | 2 # Number of statements 11 | 12 | 1 13 | # S2 {i, j | 0<=i<=n; 0<=j<=i} 14 | 4 6 15 | # i j n m 1 16 | 1 1 0 0 0 0 17 | 1 -1 0 1 0 0 18 | 1 0 1 0 0 0 19 | 1 1 -1 0 0 0 20 | 0 0 0 21 | 22 | 1 23 | # S2 {i, j | 0<=i<=n; 0<=j<=m} 24 | 4 6 25 | # i j n m 1 26 | 1 1 0 0 0 0 27 | 1 -1 0 1 0 0 28 | 1 0 1 0 0 0 29 | 1 0 -1 0 1 0 30 | 0 0 0 31 | 0 32 | 33 | 0 # Scattering functions 34 | -------------------------------------------------------------------------------- /test/reservoir/bastoul3.cloog: -------------------------------------------------------------------------------- 1 | # Figure 4 from "Efficient code generation for automatic parallelization 2 | # and optimization". 3 | # 4 | # Language 5 | c 6 | 7 | # Context 8 | 9 | 1 2 10 | 1 1 11 | 0 12 | 13 | # Number of statements 14 | 1 15 | 16 | 1 17 | 18 | # i' i j 1 19 | 6 5 20 | 0 1 -1 -2 0 21 | 1 0 1 0 -1 22 | 1 0 -1 0 3 23 | 1 0 0 1 -1 24 | 1 0 0 -1 3 25 | 1 0 0 0 1 26 | 27 | 0 0 0 28 | 29 | 0 30 | 0 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /test/stage.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {n | n>= 0} 5 | 1 3 6 | # n 1 7 | 0 1 -10 8 | 1 9 | n 10 | 11 | 2 # Number of statements: 12 | 13 | 1 14 | # {i | 0<=i<=n} 15 | 2 4 16 | # i n 1 17 | 1 1 0 0 18 | 1 -1 1 0 19 | 0 0 0 20 | 21 | 1 22 | # {ii, i | 0<=i<=n 0<=j<=n} 23 | 3 5 24 | # i j n 1 25 | 0 -1 2 0 0 26 | 1 0 1 0 0 27 | 1 0 -1 1 0 28 | 0 0 0 29 | 0 30 | 31 | 0 # Scattering functions 32 | 33 | 1 6 34 | # c1 j i n 1 35 | 0 1 -1 -1 0 0 36 | 0 37 | -------------------------------------------------------------------------------- /test/yosr2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/yosr2.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.02s. */ 2 | for (i=1;i<=M;i++) { 3 | S2(i) ; 4 | } 5 | for (proc=2;proc<=M-1;proc++) { 6 | for (i=1;i<=proc-1;i++) { 7 | S4(i,proc) ; 8 | } 9 | for (j=1;j<=proc-1;j++) { 10 | S1(proc,j) ; 11 | } 12 | for (j=proc+1;j<=M;j++) { 13 | for (k=1;k<=proc-1;k++) { 14 | S3(proc,j,k) ; 15 | } 16 | } 17 | } 18 | for (i=1;i<=M-1;i++) { 19 | S4(i,M) ; 20 | } 21 | for (j=1;j<=M-1;j++) { 22 | S1(M,j) ; 23 | } 24 | -------------------------------------------------------------------------------- /test/singleton.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/singleton.cloog by CLooG 0.14.0-242-g720faff gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1() { hash(1); } 11 | #define S2() { hash(2); } 12 | 13 | void test() 14 | { 15 | S2(); 16 | S1(); 17 | } 18 | -------------------------------------------------------------------------------- /test/lineality-2-1-2.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | # {M | 2<=M} 6 | 2 3 7 | # M 1 8 | 1 1 -2 9 | 1 0 1 10 | 0 11 | 12 | 2 # Number of statements 13 | 14 | 1 15 | # {i,j,M | 1<=i<=M; 1<=j<=M} 16 | 5 5 17 | # i j M 1 18 | 1 1 0 0 -1 19 | 1 0 1 0 -1 20 | 1 -1 0 1 0 21 | 1 0 -1 1 0 22 | 1 0 0 0 1 23 | 0 0 0 24 | 25 | 1 26 | # {i,j,M | i=j-2; 3<=j<=M+2} 27 | 4 5 28 | # i j M 1 29 | 0 1 -1 0 2 30 | 1 0 1 0 -3 31 | 1 0 -1 1 2 32 | 1 0 0 0 1 33 | 0 0 0 34 | 0 35 | 36 | 0 # Scattering functions 37 | -------------------------------------------------------------------------------- /test/multi-mm-1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | #{M,N|M>N} 6 | 3 4 7 | # M N 1 8 | 1 1 -1 0 9 | 1 0 1 -1 10 | 1 0 0 1 11 | 0 12 | 13 | 2 # Number of statements 14 | 15 | 1 16 | # 17 | 4 6 18 | # i j M N 1 19 | 1 0 1 0 0 0 20 | 1 1 -1 0 0 0 21 | 1 -1 0 1 0 0 22 | 1 0 0 0 0 1 23 | 0 0 0 24 | 25 | 1 26 | # 27 | 5 6 28 | # i j M N 1 29 | 1 0 1 0 0 0 30 | 1 1 -1 0 0 0 31 | 1 -1 0 1 0 0 32 | 1 0 -1 0 1 0 33 | 1 0 0 0 0 1 34 | 0 0 0 35 | 0 36 | 37 | 0 # Scattering functions 38 | -------------------------------------------------------------------------------- /test/non_optimal/nul_complex1.cloog: -------------------------------------------------------------------------------- 1 | # Optimal code is in fact : 2 | # 3 | # for (i=0;i<=M;i+=2) { 4 | # S1 ; 5 | # } 6 | 7 | # language: C 8 | c 9 | 10 | # parameter n 11 | 1 3 12 | # n 1 13 | 1 0 1 14 | 1 15 | n 16 | 17 | 1 # Number of statements 18 | 19 | 1 20 | # {i | 0<=i<=n} 21 | 4 5 22 | # i j n 1 23 | 1 1 0 0 0 24 | 1 -1 0 1 0 25 | 1 0 1 0 0 26 | 1 0 -1 1 0 27 | 0 0 0 28 | 0 29 | 30 | 1 # Scattering functions 31 | 32 | 2 7 33 | # c1 c2 i j n 1 34 | 0 1 0 -2 -3 0 0 35 | 0 0 1 -2 -2 0 0 36 | 37 | 0 38 | -------------------------------------------------------------------------------- /test/openscop/clay.c: -------------------------------------------------------------------------------- 1 | /* Useful macros. */ 2 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 3 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 4 | #define max(x,y) ((x) > (y) ? (x) : (y)) 5 | #define min(x,y) ((x) < (y) ? (x) : (y)) 6 | 7 | #ifdef TIME 8 | #define IF_TIME(foo) foo; 9 | #else 10 | #define IF_TIME(foo) 11 | #endif 12 | 13 | /* Scattering iterators. */ 14 | int __ii0; 15 | 16 | for (__ii0=0;__ii0<=10;__ii0++) { 17 | for (i=4*__ii0;i<=min(41,4*__ii0+3);i++) { 18 | S1(i); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/dot.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters {M, N | M>=1 N >=1} 5 | 2 4 6 | 1 1 0 -1 7 | 1 0 1 -1 8 | 0 9 | 10 | 2 # Number of statements 11 | 12 | 1 13 | # {i, j | i=0 0<=i<=N 1<=j<=M} 14 | 5 6 15 | 0 1 0 0 0 0 16 | 1 1 0 0 0 0 17 | 1 -1 0 0 1 0 18 | 1 0 1 0 0 -1 19 | 1 0 -1 1 0 0 20 | 0 0 0 21 | 22 | 1 23 | # {i, j | i>=1 0<=i<=N 1<=j<=M} 24 | 5 6 25 | 1 1 0 0 0 -1 26 | 1 1 0 0 0 0 27 | 1 -1 0 0 1 0 28 | 1 0 1 0 0 -1 29 | 1 0 -1 1 0 0 30 | 0 0 0 31 | 0 32 | 33 | 0 # Scattering functions 34 | -------------------------------------------------------------------------------- /test/reservoir/lim-lam4.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/lim-lam4.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ 2 | if (M >= 2) { 3 | S1(1,0,0); 4 | for (c2=2;c2<=2*M-2;c2++) { 5 | for (c4=max(-M+1,-c2+1);c4<=-1;c4++) { 6 | for (i=max(1,c2-M+1);i<=min(M-1,c2+c4);i++) { 7 | S1(i,(c2+c4-i),-c4); 8 | } 9 | for (c6=max(-c4,c2-M+1);c6<=min(M-1,c2-1);c6++) { 10 | S2((c2-c6),(c4+c6),c6); 11 | } 12 | } 13 | for (i=max(1,c2-M+1);i<=min(c2,M-1);i++) { 14 | S1(i,(c2-i),0); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/square+triangle-1-1-2-3.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | # {M | M >= 1} 6 | 2 3 7 | # M 1 8 | 1 1 -1 9 | 1 0 1 10 | 0 11 | 12 | 2 # Number of statements 13 | 14 | 1 15 | # {i, j | 1<=i<=M; 1<=j<=M} 16 | 5 5 17 | # i j M 1 18 | 1 1 0 0 -1 19 | 1 -1 0 1 0 20 | 1 0 1 0 -1 21 | 1 0 -1 1 0 22 | 1 0 0 0 1 23 | 0 0 0 24 | 25 | 1 26 | # {i, j | 2<=j<=i<=M} 27 | 4 5 28 | # i j M 1 29 | 1 0 1 0 -2 30 | 1 1 -1 0 0 31 | 1 -1 0 1 0 32 | 1 0 0 0 1 33 | 0 0 0 34 | 0 35 | 36 | 0 # Scattering functions 37 | -------------------------------------------------------------------------------- /test/readme.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {n | n>=2} {m | m>=2} 5 | 2 4 6 | # m n 1 7 | 1 1 0 -2 8 | 1 0 1 -2 9 | 1 # We set manually the parameter names: m, n 10 | m n 11 | 12 | 1 # Number of statements: 13 | 14 | 1 15 | # {i, j | 2<=i<=n 2<=j<=m n+2-i-j>=0} 16 | 5 6 17 | # i j m n 1 18 | 1 1 0 0 0 -2 19 | 1 -1 0 0 1 0 20 | 1 0 1 0 0 -2 21 | 1 0 -1 1 0 0 22 | 1 -1 -1 0 1 2 23 | 0 0 0 24 | 1 # We set manually the iterator names: i, j 25 | i j 26 | 27 | 0 # No scattering functions 28 | -------------------------------------------------------------------------------- /test/yosr.omega: -------------------------------------------------------------------------------- 1 | # CLooG -> OMEGA 2 | # This is an automatic dump of an input file from a CloogProgram data 3 | # structure. It can be correct ONLY if dumped before loop generation. 4 | 5 | # Context (1 parameter(s)). 6 | Symbolic n ; 7 | 8 | # Iteration domains: 9 | IS10:={[i,j]: i-1>=0 && -i+j-1>=0 && -j+n>=0 && 1>=0} ; 10 | IS20:={[i,j,k]: i-1>=0 && -i+j-1>=0 && -j+n>=0 && -i+k-1>=0 && -k+n>=0 && 1>=0} ; 11 | 12 | # Schedules: 13 | T10:={[i,j] -> [i,i,j,0]} ; 14 | T20:={[i,j,k] -> [k,i,j,k]} ; 15 | 16 | # CodeGen call: 17 | codegen 4 T10:IS10, T20:IS20 ; 18 | -------------------------------------------------------------------------------- /test/basic-bounds-2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-2.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test() 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | S1(0) ; 17 | } 18 | -------------------------------------------------------------------------------- /test/basic-bounds-6.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-6.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test() 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | S1(-1) ; 17 | } 18 | -------------------------------------------------------------------------------- /test/tiling2.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {n | n>= 0} 5 | 1 3 6 | # n 1 7 | 1 1 0 8 | 1 9 | n 10 | 11 | 1 # Number of statements: 12 | 13 | 1 14 | # {ii, i, j | t*ii<=i<=t*ii+t-1 0<=i<=n 0<=j<=n} 15 | 6 6 16 | # ii i j n 1 17 | 1 0 1 0 0 0 18 | 1 0 -1 0 1 0 19 | 1 0 0 1 0 0 20 | 1 0 0 -1 1 0 21 | 1 3 -2 -1 0 2 22 | 1 -3 2 1 0 0 23 | 0 0 0 24 | 1 25 | ii i j 26 | 27 | 0 # Scattering functions 28 | 29 | 1 7 30 | # c1 ii i j n 1 31 | 0 1 -1 -2 0 0 0 32 | 0 33 | -------------------------------------------------------------------------------- /test/equality2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./equality2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ 2 | for (i0=1;i0<=10000;i0++) { 3 | for (i1=1000;i1<=1016;i1++) { 4 | for (i2=1;i2<=min(-2*i1+2033,2*i1-1999);i2++) { 5 | if (2*i1 == i2+1999) { 6 | S2(i0,i1,i2,1,i0,(2*i1-1000),1,2,i0,(i1-499),(2*i1-1999),i0,(2*i1-1999),(i1-999),(i1-999)); 7 | } 8 | if (i2 == 1) { 9 | if (i1%2 == 0) { 10 | S1(i0,i1,i2,2,i0,((i1+2)/2),(i1-999),i0,(i1-999),((i1-998)/2),((i1-998)/2)); 11 | } 12 | } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /test/reservoir/long.c: -------------------------------------------------------------------------------- 1 | /* Generated from long.cloog by CLooG v0.14.0 64 bits in 11.58s. */ 2 | /* CLooG asked for 1888 KBytes. */ 3 | for (c2=1;c2<=O-1;c2++) { 4 | for (c4=Q;c4<=N-1;c4++) { 5 | for (c6=P;c6<=M-1;c6++) { 6 | S1(i = c2,j = c4,k = c6) ; 7 | } 8 | for (c6=1;c6<=M-1;c6++) { 9 | S2(i = c2,j = c4,k = c6) ; 10 | } 11 | } 12 | for (c4=1;c4<=N-1;c4++) { 13 | for (c6=P;c6<=M-1;c6++) { 14 | S3(i = c2,j = c4,k = c6) ; 15 | } 16 | for (c6=1;c6<=M-1;c6++) { 17 | S4(i = c2,j = c4,k = c6) ; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/logopar.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | 3 4 6 | # m n 1 7 | 1 1 -1 0 # m > n 8 | 1 1 0 0 # m >= 0 9 | 1 0 1 -2 # n >= 2 10 | 1 11 | m n 12 | 13 | 2 # Number of statements 14 | 15 | 1 16 | 3 6 17 | # i j m n 1 18 | 1 1 0 0 0 -1 # i >= 1 19 | 1 0 -1 1 0 0 # j <= m 20 | 1 -1 1 0 0 1 # j >= i-1 21 | 0 0 0 22 | 23 | 1 24 | 4 6 25 | # i j m n 1 26 | 1 1 0 0 0 -2 # i >= 2 27 | 1 -1 0 0 1 0 # i <= n 28 | 1 0 1 0 0 0 # j >= 0 29 | 1 0 -1 0 1 0 # j <= n 30 | 0 0 0 31 | 0 32 | 33 | 0 # Scattering functions 34 | -------------------------------------------------------------------------------- /test/mode.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/mode.cloog by CLooG 0.14.0-284-ga90f184 gmp bits in 0.00s. */ 2 | if (M >= 0) { 3 | if (N >= 0) { 4 | for (i=0;i<=M;i++) { 5 | for (j=0;j<=min(N,i);j++) { 6 | S1(i,j); 7 | S2(i,j); 8 | } 9 | for (j=N+1;j<=i;j++) { 10 | S1(i,j); 11 | } 12 | for (j=i+1;j<=N;j++) { 13 | S2(i,j); 14 | } 15 | } 16 | } 17 | if (N <= -1) { 18 | for (i=0;i<=M;i++) { 19 | for (j=0;j<=i;j++) { 20 | S1(i,j); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/walters.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./walters.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | S2(1,0,1,0); 3 | S4(1,0,1,0); 4 | S3(2,0,1,1); 5 | S4(2,0,1,1); 6 | for (i=3;i<=10;i++) { 7 | if ((i+1)%3 == 0) { 8 | S3(i,((i-2)/3),((i+1)/3),((i+1)/3)); 9 | } 10 | if ((i+2)%3 == 0) { 11 | S2(i,((i-1)/3),((i+2)/3),((i-1)/3)); 12 | } 13 | if (i%3 == 0) { 14 | S1(i,(i/3),(i/3),(i/3)); 15 | } 16 | div36 = floord(i,3); 17 | div37 = ceild(2*i-3*div36-1,3); 18 | if (div37 <= floord(i+2,3)) { 19 | S4(i,div36,div37,(i-div36-div37)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/min-2-1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | # {M,N | 1>=0} 6 | 1 4 7 | # M N 1 8 | 1 0 0 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | # {i,j |1<=i<=N; 0<=j<=M; j<=i; j+i<=N}, i.e. 15 | # {i,j | (1,j)<=i<=-j+N; 0<=j<=M} 16 | 10 7 17 | # i j k M N 1 18 | 1 1 0 0 0 0 -1 19 | 1 0 1 0 0 0 0 20 | 1 0 -1 0 1 0 0 21 | 1 1 -1 0 0 0 0 22 | 1 -1 -1 0 0 1 0 23 | 1 0 0 1 0 0 0 24 | 1 0 0 -1 1 0 0 25 | 1 1 0 -1 0 0 0 26 | 1 -1 0 -1 0 1 0 27 | 1 0 0 0 0 0 1 28 | 0 0 0 29 | 0 30 | 31 | 0 # Scattering functions 32 | -------------------------------------------------------------------------------- /test/reservoir/pingali1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/pingali1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | if ((M >= 1) && (N >= 1)) { 3 | if (N >= 2) { 4 | for (c2=1;c2<=M;c2++) { 5 | S2(c2,1); 6 | for (c4=3;c4<=2*N-1;c4++) { 7 | for (c6=max(1,c4-N);c6<=floord(c4-1,2);c6++) { 8 | S1(c2,(c4-c6),c6); 9 | } 10 | if ((c4+1)%2 == 0) { 11 | S2(c2,((c4+1)/2)); 12 | } 13 | } 14 | } 15 | } 16 | if (N == 1) { 17 | for (c2=1;c2<=M;c2++) { 18 | S2(c2,1); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/gesced3.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parametres {n | n>=m m>=2} 5 | 2 4 6 | # m n 1 7 | 1 -1 1 0 8 | 1 1 0 -2 9 | 0 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i | 1<=i<=n} 15 | 2 5 16 | # i m n 1 17 | 1 1 0 0 -1 18 | 1 -1 0 1 0 19 | 0 0 0 20 | 21 | 1 22 | # {i | 1<=i<=n} 23 | 2 5 24 | # i m n 1 25 | 1 1 0 0 -1 26 | 1 -1 0 1 0 27 | 0 0 0 28 | 0 29 | 30 | 2 31 | # Et les instructions de chunking (sol triviale)... 32 | 1 6 33 | # c1 i m n 1 34 | 0 1 -1 -1 0 0 35 | 36 | 1 6 37 | # c1 i m n 1 38 | 0 1 -1 -2 0 0 39 | 0 40 | -------------------------------------------------------------------------------- /test/stride4.cloog: -------------------------------------------------------------------------------- 1 | # Language: C 2 | c 3 | 4 | # Context: 5 | 1 6 | 7 | 0 3 0 0 0 1 8 | 9 | 1 # Parameter name(s) 10 | t 11 | # Statement number: 12 | 1 13 | 14 | # Iteration domain of statement 1. 15 | 1 16 | 17 | 6 6 2 0 1 1 18 | 0 1 0 16 -1 0 19 | 0 0 1 0 -1 0 20 | 1 1 0 0 0 0 21 | 1 -1 0 0 0 99 22 | 1 0 0 0 1 0 23 | 1 0 0 0 -1 15 24 | 25 | 0 0 0 # For future options. 26 | 27 | 28 | 1 # Iterator name(s) 29 | 30 | i0 i1 31 | 32 | # No scattering functions. 33 | 0 34 | -------------------------------------------------------------------------------- /test/1point-1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/1point-1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int M) 13 | { 14 | /* Original iterators. */ 15 | int i, j; 16 | i = 2*M ; 17 | S1(2*M,M) ; 18 | } 19 | -------------------------------------------------------------------------------- /test/ard.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | #{ | } 6 | 1 2 7 | # 1 8 | 1 1 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 14 | 9 13 15 | 0 1 0 0 0 0 0 0 0 0 0 0 0 16 | 0 0 0 1 0 0 0 0 0 -1 0 -1 0 17 | 0 0 0 0 1 0 0 -1 0 1 0 1 0 18 | 0 0 0 0 0 0 0 0 1 -1 0 0 0 19 | 0 0 0 0 0 0 0 0 0 0 1 -1 0 20 | 1 0 0 0 0 0 -1 0 0 0 0 0 0 21 | 1 0 0 0 0 -1 0 0 0 0 0 0 0 22 | 1 0 1 0 0 0 0 0 0 0 0 0 -1 23 | 1 0 0 0 0 0 0 0 0 0 0 0 1 24 | 0 0 0 25 | 0 26 | 27 | 28 | 0 # Scattering functions 29 | -------------------------------------------------------------------------------- /test/openscop/empty.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from empty.scop by CLooG 0.20.0-044a1d0 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S0 { hash(0); } 17 | #define S1() { hash(1); } 18 | 19 | void test() 20 | { 21 | S0 22 | } 23 | -------------------------------------------------------------------------------- /test/lineality-1-2.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # Context 5 | # {M | 2<=M} 6 | 2 3 7 | # M 1 8 | 1 1 -2 9 | 1 0 1 10 | 0 11 | 12 | 2 # Number of statements 13 | 14 | 1 15 | # {i,j,M | 1<=i<=M; 1<=j<=M} 16 | 5 5 17 | # i j M 1 18 | 1 1 0 0 -1 19 | 1 0 1 0 -1 20 | 1 -1 0 1 0 21 | 1 0 -1 1 0 22 | 1 0 0 0 1 23 | 0 0 0 24 | 25 | 1 26 | # {i,j,M | i=j; 1<=j<=M} 27 | 4 5 28 | # i j M 1 29 | 0 1 -1 0 0 30 | 1 0 1 0 -1 31 | 1 0 -1 1 0 32 | 1 0 0 0 1 33 | 0 0 0 34 | 0 35 | 36 | 0 # Scattering functions 37 | -------------------------------------------------------------------------------- /test/backtrack.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/backtrack.cloog by CLooG 0.14.0-367-gf043665 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test() 13 | { 14 | /* Scattering iterators. */ 15 | int c1; 16 | /* Original iterators. */ 17 | int i; 18 | S1(0); 19 | } 20 | -------------------------------------------------------------------------------- /test/basic-bounds-1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test() 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | for (i=0;i<=2;i++) { 17 | S1(i) ; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/basic-bounds-3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-3.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test(int M) 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | for (i=0;i<=M;i++) { 17 | S1(i) ; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/basic-bounds-4.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-4.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test(int M) 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | for (i=0;i<=M+1;i++) { 17 | S1(i) ; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/basic-bounds-5.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/basic-bounds-5.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int M) 13 | { 14 | /* Original iterators. */ 15 | int i, j; 16 | j = floord(M+1,2) ; 17 | S1(1,j) ; 18 | } 19 | -------------------------------------------------------------------------------- /include/cloog/matrix/constraintset.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOOG_MATRIX_CONSTRAINTSET_H 2 | #define CLOOG_MATRIX_CONSTRAINTSET_H 3 | 4 | #if defined(__cplusplus) 5 | extern "C" 6 | { 7 | #endif 8 | 9 | struct cloogconstraintset { 10 | CloogMatrix M; 11 | }; 12 | 13 | struct cloogequalities { 14 | CloogConstraintSet *constraints; 15 | int *types; 16 | }; 17 | 18 | struct cloogconstraint { 19 | CloogConstraintSet *set; 20 | cloog_int_t **line; 21 | }; 22 | 23 | CloogConstraintSet *cloog_constraint_set_from_cloog_matrix(CloogMatrix *M); 24 | 25 | #if defined(__cplusplus) 26 | } 27 | #endif 28 | #endif /* define _H */ 29 | -------------------------------------------------------------------------------- /test/1point-2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/1point-2.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int M, int N) 13 | { 14 | /* Original iterators. */ 15 | int i, j; 16 | i = 2*M ; 17 | j = N+2 ; 18 | S1(2*M,N+2) ; 19 | } 20 | -------------------------------------------------------------------------------- /test/quillere.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {n | n>= 0} 5 | 3 4 6 | # n m 1 7 | 1 1 0 -4 8 | 1 0 1 -4 9 | 1 1 -1 0 10 | 1 11 | n m 12 | 13 | 2 # Number of statements: 14 | 15 | 1 16 | # {i, j | 1<=i<=n 1<=j<=m} 17 | 4 6 18 | # i j n m 1 19 | 1 1 0 0 0 -1 20 | 1 -1 0 1 0 0 21 | 1 0 1 0 0 -1 22 | 1 0 -1 0 1 0 23 | 0 0 0 24 | 25 | 1 26 | # {i, j | i=j 3<=j<=n} 27 | 3 6 28 | # i j n m 1 29 | 0 1 -1 0 0 0 30 | 1 0 1 0 0 -3 31 | 1 0 -1 1 0 0 32 | 0 0 0 33 | 0 34 | 35 | 0 # Scattering functions 36 | -------------------------------------------------------------------------------- /test/min-4-1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/min-4-1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test(int M, int N, int O) 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | for (i=max(-M,-N);i<=min(O,N);i++) { 17 | S1(i) ; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/reservoir/lim-lam1.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/lim-lam1.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. */ 2 | S1(1,100); 3 | for (c2=-98;c2<=99;c2++) { 4 | if (c2 <= 0) { 5 | S1(1,(-c2+1)); 6 | } 7 | if (c2 >= 1) { 8 | S2(c2,1); 9 | } 10 | for (c4=max(2,-2*c2+3);c4<=min(199,-2*c2+200);c4++) { 11 | if (c4%2 == 0) { 12 | S1(((2*c2+c4)/2),(c4/2)); 13 | } 14 | if ((c4+1)%2 == 0) { 15 | S2(((2*c2+c4-1)/2),((c4+1)/2)); 16 | } 17 | } 18 | if (c2 <= 0) { 19 | S1((c2+100),100); 20 | } 21 | if (c2 >= 1) { 22 | S2(100,(-c2+101)); 23 | } 24 | } 25 | S2(100,1); 26 | -------------------------------------------------------------------------------- /test/gesced2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./gesced2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ 2 | for (c1=1;c1<=4;c1++) { 3 | for (c2=5;c2<=M-10;c2++) { 4 | S1(c1,c2); 5 | } 6 | } 7 | for (c1=5;c1<=M-10;c1++) { 8 | for (c2=-c1+1;c2<=4;c2++) { 9 | S2((c1+c2),c1); 10 | } 11 | for (c2=5;c2<=min(M-10,-c1+M);c2++) { 12 | S1(c1,c2); 13 | S2((c1+c2),c1); 14 | } 15 | for (c2=-c1+M+1;c2<=M-10;c2++) { 16 | S1(c1,c2); 17 | } 18 | for (c2=M-9;c2<=-c1+M;c2++) { 19 | S2((c1+c2),c1); 20 | } 21 | } 22 | for (c1=M-9;c1<=M;c1++) { 23 | for (c2=5;c2<=M-10;c2++) { 24 | S1(c1,c2); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/published/Web/web7.cloog: -------------------------------------------------------------------------------- 1 | # CLooG example file #7: A useful basis to start writing its own input file. 2 | # 1. Language: C 3 | c 4 | 5 | # 2. Parameters {M | M>=0}. 6 | 1 3 7 | # M 1 8 | 1 1 0 9 | 10 | # 3. We let CLooG choose the parameter names. 11 | 0 12 | 13 | # 4. Number of polyhedra: 14 | 1 15 | 16 | # 5. Polyhedron #1 {i, j | 0<=i<=M 0<=j<=M}. 17 | 1 18 | 4 5 19 | # i j M 1 20 | 1 1 0 0 0 21 | 1 -1 0 1 0 22 | 1 0 1 0 0 23 | 1 0 -1 1 0 24 | 0 0 0 25 | 26 | # 6. We let CLooG choose the iterator names. 27 | 0 28 | 29 | # 7. Let CLoog scan the polyhedra in the way it wants. 30 | 0 31 | -------------------------------------------------------------------------------- /test/iftest.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | # The context (no constraints on parameters) 4 | 1 4 # 1 lines and 4 columns 5 | # m n 1 6 | 1 0 0 0 7 | 1 8 | m n 9 | 10 | 1 # The number of statements 11 | 12 | 2 # First statement 13 | # The first domain 14 | 3 5 # 3 lines and 5 columns 15 | # i m n 1 16 | 1 1 0 0 -1 # i >= 1 17 | 1 -1 0 1 0 # i <= n 18 | 1 1 -1 0 0 # i >= m 19 | # The second domain 20 | 3 5 # 3 lines and 5 columns 21 | # i m n 1 22 | 1 1 0 0 -1 # i >= 1 23 | 1 -1 0 1 0 # i <= n 24 | 1 -1 2 0 0 # i <= 2*m 25 | 0 0 0 26 | 0 27 | 28 | 0 29 | -------------------------------------------------------------------------------- /test/isl/stride.cloog: -------------------------------------------------------------------------------- 1 | # CLooG script generated automatically by PLUTO 0.7.0 2 | # language: C 3 | c 4 | 5 | [m] -> {:} 6 | 7 | 0 8 | 9 | # Number of statements 10 | 1 11 | 12 | [m] -> { [i0, i1, i2, i3] : 0 <= i2 <= 2 and 1 <= i3 <= m - 2 and i3 >= 4i0 - 2i2 and i3 <= 3 + 4i0 - 2i2 and i3 <= -4i1 + 2i2 and i3 >= -3 - 4i1 + 2i2 } 13 | 14 | 0 0 0 15 | 16 | # we want cloog to set the iterator names 17 | 0 18 | 19 | # of scattering functions 20 | 1 21 | [m] -> { [i0, i1, i2, i3] -> [s0, i1, s2, s3]: 22 | i0 = s0 - i1 and 4i2 = -2 + s2 + s3 and 2i3 = s2 - s3 } 23 | 24 | 25 | 26 | # we will set the scattering dimension names 27 | 0 28 | 29 | -------------------------------------------------------------------------------- /test/overlap.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter {n d | n >= 0 d >= 0} 5 | 2 4 6 | # n d 1 7 | 1 1 0 0 8 | 1 0 1 0 9 | 1 10 | n d 11 | 12 | 2 # Number of statements: 13 | 14 | 1 15 | # {i, j | n<=i<=2*n n<=j<=2*n} 16 | 4 6 17 | # i j n d 1 18 | 1 1 0 -1 0 0 19 | 1 -1 0 2 0 0 20 | 1 0 1 -1 0 0 21 | 1 0 -1 2 0 0 22 | 0 0 0 23 | 24 | 1 25 | # {i, j | n+d<=i<=2*n+d n+d<=j<=2*n+d} 26 | 4 6 27 | # i j n d 1 28 | 1 1 0 -1 -1 0 29 | 1 -1 0 2 1 0 30 | 1 0 1 -1 -1 0 31 | 1 0 -1 2 1 0 32 | 0 0 0 33 | 0 34 | 35 | 0 # Scattering functions 36 | -------------------------------------------------------------------------------- /test/non_optimal/dreamupT3.omega: -------------------------------------------------------------------------------- 1 | # CLooG -> OMEGA 2 | # This is an automatic dump of an input file from a CloogProgram data 3 | # structure. It can be correct ONLY if dumped before loop generation. 4 | 5 | # Context (0 parameter(s)). 6 | # Iteration domains: 7 | IS10:={[c1,c2]: c1>=0 && -c1+31>=0 && c2>=0 && -c2+511>=0} ; 8 | IS20:={[c1]: c1>=0 && -c1+127>=0} ; 9 | IS30:={[c1,c2]: c1>=0 && -c1+126>=0 && c2>=0 && -c2+127>=0} ; 10 | 11 | # Schedules: 12 | T10:={[c1,c2] -> [1536c1+3c2,c1,c2]} ; 13 | T20:={[c1] -> [384c1+1534,c1,0]} ; 14 | T30:={[c1,c2] -> [384c1+3c2+1919,c1,c2]} ; 15 | 16 | # CodeGen call: 17 | codegen 3 T10:IS10, T20:IS20, T30:IS30 ; 18 | -------------------------------------------------------------------------------- /test/iftestf.cloog: -------------------------------------------------------------------------------- 1 | # language: FORTRAN 2 | f 3 | 4 | # The context (no constraints on parameters) 5 | 1 4 # 1 lines and 4 columns 6 | # m n 1 7 | 1 0 0 0 8 | 1 9 | m n 10 | 11 | 1 # The number of statements 12 | 13 | 2 # First statement 14 | # The first domain 15 | 3 5 # 3 lines and 5 columns 16 | # i m n 1 17 | 1 1 0 0 -1 # i >= 1 18 | 1 -1 0 1 0 # i <= n 19 | 1 1 -1 0 0 # i >= m 20 | # The second domain 21 | 3 5 # 3 lines and 5 columns 22 | # i m n 1 23 | 1 1 0 0 -1 # i >= 1 24 | 1 -1 0 1 0 # i <= n 25 | 1 -1 2 0 0 # i <= 2*m 26 | 0 0 0 27 | 0 28 | 29 | 0 30 | -------------------------------------------------------------------------------- /test/no_lindep.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/no_lindep.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test(int M, int N) 13 | { 14 | /* Scattering iterators. */ 15 | int c1, c2; 16 | /* Original iterators. */ 17 | int i; 18 | c1 = M+1 ; 19 | i = N+2 ; 20 | S1(N+2) ; 21 | } 22 | -------------------------------------------------------------------------------- /test/isl/unroll2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/isl/unroll2.cloog by CLooG 0.16.3-13-g27516e4 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test(int M) 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | if ((M >= -1) && (M <= 9)) { 17 | for (i=max(0,M);i<=M+1;i++) { 18 | S1(i); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/reservoir/pingali5.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/pingali5.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ 2 | if (M >= 2) { 3 | for (c2=3;c2<=2*M-3;c2++) { 4 | for (c4=ceild(c2+3,2);c4<=M;c4++) { 5 | for (i=ceild(c2+1,2);i<=min(c2-1,c4-1);i++) { 6 | S1(i,(c2-i),c4); 7 | } 8 | } 9 | for (c4=max(1,c2-M);c4<=floord(c2-1,2);c4++) { 10 | S2((c2-c4),c4); 11 | } 12 | for (c4=ceild(c2+3,2);c4<=M;c4++) { 13 | for (i=ceild(c2+1,2);i<=min(c2-1,c4-1);i++) { 14 | S3(i,(c2-i),c4); 15 | } 16 | } 17 | } 18 | for (c2=max(M+1,2*M-2);c2<=2*M-1;c2++) { 19 | S2(M,(c2-M)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/isl/stride.c: -------------------------------------------------------------------------------- 1 | /* Generated from stride.cloog by CLooG 0.17.0 gmp bits in 0.29s. */ 2 | if (M >= 3) { 3 | for (c1=-1;c1<=min(2,floord(M+2,4));c1++) { 4 | for (c2=max(ceild(2*c1-M+1,4),ceild(4*c1-M-2,4));c2<=min(0,floord(c1,2));c2++) { 5 | for (c3=max(max(-4*c2-2,4*c2+3),4*c1-4*c2+1);c3<=min(min(min(M+3,-4*c2+9),4*c2+2*M),4*c1-4*c2+4);c3++) { 6 | for (c4=max(3*c3-4*floord(c3+M+1,2)+6,4*c2-c3-4*floord(-c3+1,4)+2);c4<=min(min(4*c2+4,-c3+10),c3-2);c4+=4) { 7 | if ((c2 <= floord(c4-1,4)) && (c2 >= ceild(c4-4,4))) { 8 | S1(c1-c2,c2,(c3+c4-2)/4,(c3-c4)/2); 9 | } 10 | } 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/min-3-1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/min-3-1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int M) 13 | { 14 | /* Original iterators. */ 15 | int i, j; 16 | for (i=0;i<=min(10,M);i++) { 17 | for (j=0;j<=min(10,M);j++) { 18 | S1(i,j) ; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/isl/unroll.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./isl/unroll.cloog by CLooG 0.16.3-14-g80e4ef0 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test(int M) 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | S1(0); 17 | S1(1); 18 | S1(2); 19 | S1(3); 20 | S1(4); 21 | S1(5); 22 | S1(6); 23 | S1(7); 24 | S1(8); 25 | S1(9); 26 | S1(10); 27 | } 28 | -------------------------------------------------------------------------------- /test/openscop/coordinates.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from coordinates.scop by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i) { hash(1); hash(i); } 17 | 18 | void test() 19 | { 20 | /* Original iterators. */ 21 | int i; 22 | for (i=0;i<=41;i++) { 23 | S1(i); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/multi-stride.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from multi-stride.cloog by CLooG 0.20.0-044a1d0 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S0 { hash(0); } 17 | #define S1(i,j,k) { hash(1); hash(i); hash(j); hash(k); } 18 | 19 | void test() 20 | { 21 | /* Original iterators. */ 22 | int i, j, k; 23 | S0 24 | } 25 | -------------------------------------------------------------------------------- /test/non_optimal/dreamupT1.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter: none 5 | 1 2 6 | # 1 7 | 1 0 # 0 >= 0 8 | 9 | 0 10 | 11 | 1 # Number of statements 12 | 13 | 1 # One domain 14 | 4 4 # 4 lines and 4 columns 15 | # c1 c2 1 16 | 1 1 0 0 # c1 >= 0 17 | 1 -1 0 31 # c1 <= 31 18 | 1 0 1 0 # c2 >= 0 19 | 1 0 -1 511 # c2 <= 511 20 | 0 0 0 # for future options 21 | 22 | 1 # set manually the iterator names 23 | c1 c2 24 | 25 | 1 # Scattering functions 26 | 27 | 1 5 28 | # d c1 c2 1 29 | 0 1 -1536 -3 0 # d = 1536*c1 + 3*c2 30 | 31 | 1 # set manually the scattering dimension names 32 | d 33 | -------------------------------------------------------------------------------- /doc/ROADMAP: -------------------------------------------------------------------------------- 1 | still to do before 2 | 0.14.0 - dumping functions 3 | - backtrack only to remove ifs 4 | - update documentation 5 | - configure for GMP and Solaris 6 | 7 | 0.14.1 - remove the constraint that all scattering functions must have the same 8 | dimensionality and use the new liberty degrees to generate better codes 9 | (e.g. continue loop fusion only when the stride is the same...) 10 | - if-hoisting instead of backtracking by option 11 | 12 | 0.14.2 clean loop during generation (haircut and never_integral) 13 | 14 | 0.14.3 allow non-integral scattering (easy: see PACT paper) 15 | 16 | ... 17 | 18 | 1.0.0 Omega-like input. 19 | -------------------------------------------------------------------------------- /test/non_optimal/youcef.cloog: -------------------------------------------------------------------------------- 1 | # Optimal code is in fact : 2 | # 3 | # for (i=0;i<=M;i++) { 4 | # S1 ; 5 | # for (j=0;j<=N;j++) { 6 | # S2 ; 7 | # } 8 | # S3 ; 9 | # } 10 | 11 | # language: C 12 | c 13 | 14 | # parameters {M, N | M>=1 N >=1} 15 | 0 2 16 | 0 17 | 18 | 3 # Number of statements 19 | 20 | 1 21 | # {i | 0<=i<=5 i==j} 22 | 3 4 23 | 1 1 0 0 24 | 1 -1 0 5 25 | 0 1 -1 0 26 | 0 0 0 27 | 28 | 1 29 | # {i | 0<=i<=5 i<=j<=5} 30 | 4 4 31 | 1 1 0 0 32 | 1 -1 0 5 33 | 1 -1 1 0 34 | 1 0 -1 5 35 | 0 0 0 36 | 37 | 1 38 | # {i | 0<=i<=5 j==5} 39 | 3 4 40 | 1 1 0 0 41 | 1 -1 0 5 42 | 0 0 1 -5 43 | 0 0 0 44 | 0 45 | 46 | 0 # Scattering functions 47 | -------------------------------------------------------------------------------- /test/lex.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/lex.cloog by CLooG 0.14.0-234-g330f397 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i) { hash(2); hash(i); } 12 | 13 | void test() 14 | { 15 | /* Scattering iterators. */ 16 | int c1; 17 | /* Original iterators. */ 18 | int i; 19 | for (c1=0;c1<=10;c1++) { 20 | S2(c1); 21 | S1(c1); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/tiling.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/tiling.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(ii,i) { hash(1); hash(ii); hash(i); } 11 | 12 | void test(int n) 13 | { 14 | /* Original iterators. */ 15 | int ii, i; 16 | for (ii=0;ii<=floord(n,10);ii++) { 17 | for (i=max(10*ii,0);i<=min(10*ii+9,n);i++) { 18 | S1(ii,i) ; 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /test/block.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/block.cloog by CLooG 0.14.0-170-g72daac3 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1() { hash(1); } 11 | #define S2() { hash(2); } 12 | #define S3(i) { hash(3); hash(i); } 13 | 14 | void test() 15 | { 16 | /* Scattering iterators. */ 17 | int c1; 18 | /* Original iterators. */ 19 | int i; 20 | S1(); 21 | S3(0); 22 | S2(); 23 | S3(1); 24 | } 25 | -------------------------------------------------------------------------------- /test/block3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/block3.cloog by CLooG 0.16.2-4-gba4e834 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1() { hash(1); } 11 | #define S2() { hash(2); } 12 | #define S3(i) { hash(3); hash(i); } 13 | 14 | void test() 15 | { 16 | /* Scattering iterators. */ 17 | int c1; 18 | /* Original iterators. */ 19 | int i; 20 | S1(); 21 | S3(0); 22 | S2(); 23 | S3(1); 24 | } 25 | -------------------------------------------------------------------------------- /test/iftest.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/iftest.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test(int m, int n) 13 | { 14 | /* Original iterators. */ 15 | int i; 16 | for (i=1;i<=n;i++) { 17 | if (i <= 2*m) { 18 | S1(i) ; 19 | } 20 | if (i >= max(m,2*m+1)) { 21 | S1(i) ; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/isl/mod.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from mod.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i) { hash(1); hash(i); } 17 | 18 | void test() 19 | { 20 | /* Original iterators. */ 21 | int i; 22 | for (i=0;i<=3;i++) { 23 | if (i%3 <= 1) { 24 | S1(i); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/isl/mod2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from mod2.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i) { hash(1); hash(i); } 17 | 18 | void test() 19 | { 20 | /* Original iterators. */ 21 | int i; 22 | for (i=0;i<=3;i++) { 23 | if (i%3 <= 1) { 24 | S1(i); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/isl/mod3.cloog: -------------------------------------------------------------------------------- 1 | # Language: C 2 | c 3 | 4 | # Context: 5 | 2 3 6 | 1 -1 93 7 | 1 1 0 8 | 9 | 1 # Parameter name(s) 10 | h0 11 | # Statement number: 12 | 1 13 | 14 | # Iteration domain of statement 1 15 | 1 16 | 17 | 9 6 2 0 1 1 18 | 1 1 0 0 0 0 19 | 1 -1 0 0 0 999 20 | 1 0 0 -1 0 31 21 | 1 1 0 32 -32 999 22 | 1 0 1 0 0 0 23 | 1 0 -1 0 0 999 24 | 1 1 0 64 -32 31 25 | 1 -1 0 -64 32 31 26 | 1 0 0 1 0 0 27 | 28 | 0 0 0 # For future options. 29 | 30 | 31 | 0 # Iterator name(s) 32 | 33 | # No scattering functions. 34 | 0 35 | -------------------------------------------------------------------------------- /test/tiling3.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | f 3 | 4 | # parameter {n | n>= 0} 5 | 1 3 6 | # n 1 7 | 1 1 0 8 | 1 9 | n 10 | 11 | 1 # Number of statements: 12 | 13 | 1 14 | # {i, jj, j | 1<=i<=n t*jj<=j<=t*jj+t-1 1<=j<=n} 15 | 6 6 16 | # i jj j n 1 17 | 1 1 0 0 0 -1 18 | 1 -1 0 0 1 0 19 | 1 0 0 1 0 -1 20 | 1 0 0 -1 1 0 21 | 1 0 10 -1 0 9 22 | 1 0 -10 1 0 0 23 | 0 0 0 24 | 1 25 | i jj j 26 | 27 | 1 # Scattering functions 28 | 29 | 30 | 2 8 31 | # c1 c2 i jj j n 1 32 | 0 1 0 0 -1 0 0 0 33 | 0 0 1 -1 0 -1 0 0 34 | 0 35 | 36 | 37 | 1 7 38 | # c1 i jj j n 1 39 | 0 1 0 -1 0 0 0 40 | 0 41 | 42 | -------------------------------------------------------------------------------- /test/infinite4.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from infinite4.cloog by CLooG 0.20.0-0e868c5 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S0 { hash(0); } 17 | #define S1(i) { hash(1); hash(i); } 18 | 19 | void test() 20 | { 21 | /* Original iterators. */ 22 | int i; 23 | for (i=-1000;i<=1000;i++) { 24 | S1(i); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/largeur.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/largeur.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int M) 13 | { 14 | /* Scattering iterators. */ 15 | int c1, c2; 16 | /* Original iterators. */ 17 | int i, j; 18 | for (c1=1;c1<=M;c1++) { 19 | for (c2=1;c2<=c1;c2++) { 20 | S1(c2,c1) ; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/min-1-1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/min-1-1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int M, int N) 13 | { 14 | /* Original iterators. */ 15 | int i, j; 16 | if (M >= 0) { 17 | for (i=1;i<=N;i++) { 18 | for (j=0;j<=min(min(i,-i+N),M);j++) { 19 | S1(i,j) ; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/lux.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter n 5 | 1 3 6 | 1 0 1 7 | 0 8 | 9 | 2 # Number of statements 10 | 11 | 1 12 | # {c1, c2, i, j | c1=i, c2=n, 1<=i<=n; i+1<=j<=n} 13 | 6 7 14 | 0 1 -1 0 0 0 0 15 | 0 0 0 1 0 -1 0 16 | 1 0 1 0 0 0 -1 17 | 1 0 -1 0 0 1 0 18 | 1 0 -1 0 1 0 -1 19 | 1 0 0 0 -1 1 0 20 | 0 0 0 21 | 22 | 1 23 | # {c1, c2, i, j, k | c1=k, c2=j, 1<=i<=n; i+1<=j<=n i+1<=k<=n} 24 | 8 8 25 | 0 1 0 0 0 -1 0 0 26 | 0 0 0 -1 1 0 0 0 27 | 1 0 1 0 0 0 0 -1 28 | 1 0 -1 0 0 0 1 0 29 | 1 0 -1 1 0 0 0 -1 30 | 1 0 0 -1 0 0 1 0 31 | 1 0 -1 0 0 1 0 -1 32 | 1 0 0 0 0 -1 1 0 33 | 0 0 0 34 | 0 35 | 36 | 0 # Scattering functions 37 | -------------------------------------------------------------------------------- /test/vasilache.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../test/vasilache.cloog by CLooG 0.19.0-6faa51a gmp bits in 0.03s. */ 2 | S1(); 3 | S2(); 4 | for (p1=0;p1<=N-1;p1++) { 5 | for (p3=0;p3<=N-1;p3++) { 6 | S4(p1,p3); 7 | S5(p1,p3); 8 | } 9 | } 10 | for (p1=0;p1<=N-1;p1++) { 11 | for (p3=0;p3<=N-1;p3++) { 12 | for (p5=0;p5<=floord(N-1,32);p5++) { 13 | S7(p1,p3,p5,32*p5); 14 | for (p7=32*p5+1;p7<=min(N-1,32*p5+31);p7++) { 15 | S6(p1,p3,p5,(p7-1)); 16 | S7(p1,p3,p5,p7); 17 | } 18 | if (p5 <= floord(N-32,32)) { 19 | S6(p1,p3,p5,(32*p5+31)); 20 | } 21 | if (p5 >= ceild(N-31,32)) { 22 | S6(p1,p3,p5,(N-1)); 23 | } 24 | } 25 | } 26 | } 27 | S8(); 28 | -------------------------------------------------------------------------------- /test/lu2.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter n 5 | 1 3 6 | 1 0 1 7 | 1 8 | n 9 | 10 | 2 # Number of statements 11 | 12 | 1 13 | # {c1, c2, i, j | c1=i, c2=n, 1<=i<=n; i+1<=j<=n} 14 | 6 7 15 | 0 1 0 -1 0 0 0 16 | 0 0 1 0 0 -1 0 17 | 1 0 0 1 0 0 -1 18 | 1 0 0 -1 0 1 0 19 | 1 0 0 -1 1 0 -1 20 | 1 0 0 0 -1 1 0 21 | 0 0 0 22 | 23 | 1 24 | # {c1, c2, i, j, k | c1=k, c2=j, 1<=i<=n; i+1<=j<=n i+1<=k<=n} 25 | 8 8 26 | 0 1 0 0 0 -1 0 0 27 | 0 0 1 0 -1 0 0 0 28 | 1 0 0 1 0 0 0 -1 29 | 1 0 0 -1 0 0 1 0 30 | 1 0 0 -1 1 0 0 -1 31 | 1 0 0 0 -1 0 1 0 32 | 1 0 0 -1 0 1 0 -1 33 | 1 0 0 0 0 -1 1 0 34 | 0 0 0 35 | 0 36 | 37 | 0 # Scattering functions 38 | -------------------------------------------------------------------------------- /include/cloog/input.h: -------------------------------------------------------------------------------- 1 | #ifndef CLOOG_INPUT_H 2 | #define CLOOG_INPUT_H 3 | 4 | #if defined(__cplusplus) 5 | extern "C" { 6 | #endif 7 | 8 | struct osl_scop; 9 | 10 | struct clooginput { 11 | CloogDomain *context; 12 | CloogUnionDomain *ud; 13 | }; 14 | typedef struct clooginput CloogInput; 15 | 16 | CloogInput *cloog_input_from_osl_scop(CloogState *, struct osl_scop *); 17 | CloogInput *cloog_input_read(FILE *file, CloogOptions *options); 18 | CloogInput *cloog_input_alloc(CloogDomain *context, CloogUnionDomain *ud); 19 | void cloog_input_free(CloogInput *input); 20 | 21 | void cloog_input_dump_cloog(FILE *file, CloogInput *input, CloogOptions *opt); 22 | 23 | #if defined(__cplusplus) 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /test/reservoir/jacobi2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/jacobi2.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int M) 13 | { 14 | /* Scattering iterators. */ 15 | int c2, c4; 16 | /* Original iterators. */ 17 | int i, j; 18 | for (c2=0;c2<=M-1;c2++) { 19 | for (c4=0;c4<=M-1;c4++) { 20 | S1(c2,c4) ; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/reservoir/two.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/two.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j,k) { hash(1); hash(i); hash(j); hash(k); } 11 | 12 | void test() 13 | { 14 | /* Original iterators. */ 15 | int i, j, k; 16 | for (i=0;i<=1;i++) { 17 | if ((i+1)%2 == 0) { 18 | j = (-i+3)/2 ; 19 | k = (i+9)/2 ; 20 | S1(i,(-i+3)/2,(i+9)/2) ; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/stride2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from stride2.cloog by CLooG 0.14.0-200-g26bdb56 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test() 14 | { 15 | /* Scattering iterators. */ 16 | int c1, c2; 17 | /* Original iterators. */ 18 | int i, j; 19 | for (c1=3;c1<=100;c1+=3) { 20 | if (c1 == 27) { 21 | S1(27); 22 | } 23 | S2(c1,c1/3); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/iftest2.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | # The context (no constraints on parameters) 4 | 1 4 # 1 lines and 4 columns 5 | # m n 1 6 | 1 0 0 0 7 | 0 8 | 9 | 1 # The number of statements 10 | 11 | 2 # First statement 12 | # The first domain 13 | 5 6 # 3 lines and 5 columns 14 | # i j m n 1 15 | 1 1 0 0 0 -1 # i >= 1 16 | 1 -1 0 0 1 0 # i <= n 17 | 1 1 0 -1 0 0 # i >= m 18 | 1 0 1 0 0 -1 19 | 1 0 -1 1 0 0 20 | # The second domain 21 | 5 6 # 3 lines and 5 columns 22 | # i j m n 1 23 | 1 1 0 0 0 -1 # i >= 1 24 | 1 -1 0 0 1 0 # i <= n 25 | 1 -1 0 2 0 0 # i <= 2*m 26 | 1 0 1 0 0 -1 27 | 1 0 -1 1 0 0 28 | 0 0 0 29 | 0 30 | 31 | 0 32 | -------------------------------------------------------------------------------- /test/param-split.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/param-split.cloog by CLooG 0.14.0-277-gce2ba57 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i) { hash(2); hash(i); } 12 | 13 | void test(int M) 14 | { 15 | /* Original iterators. */ 16 | int i; 17 | if (M >= 0) { 18 | S1(0); 19 | S2(0); 20 | } 21 | for (i=1;i<=M;i++) { 22 | S1(i); 23 | } 24 | if (M <= -1) { 25 | S2(0); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/reservoir/pingali6.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/pingali6.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ 2 | if (N >= 3) { 3 | for (c4=2;c4<=N-1;c4++) { 4 | for (c6=2;c6<=N-1;c6++) { 5 | S1(1,c4,c6); 6 | } 7 | } 8 | for (c2=3;c2<=2*M;c2++) { 9 | for (c4=2;c4<=N-1;c4++) { 10 | for (c6=2;c6<=N-1;c6++) { 11 | if (c2%2 == 0) { 12 | S1((c2/2),c4,c6); 13 | } 14 | } 15 | } 16 | for (c4=2;c4<=N-1;c4++) { 17 | for (c6=2;c6<=N-1;c6++) { 18 | if ((c2+1)%2 == 0) { 19 | S2(((c2-1)/2),c4,c6); 20 | } 21 | } 22 | } 23 | } 24 | for (c4=2;c4<=N-1;c4++) { 25 | for (c6=2;c6<=N-1;c6++) { 26 | S2(M,c4,c6); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/walters3.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters 5 | 1 2 6 | 1 1 7 | 1 8 | 9 | 10 | 2 11 | 12 | 1 13 | 15 5 14 | 1 -1 0 0 10 15 | 1 -1 0 0 8 16 | 1 -1 0 2 1 17 | 1 1 0 -2 0 18 | 1 -1 0 2 0 19 | 1 0 0 1 -1 20 | 1 1 -2 0 0 21 | 1 -1 2 0 1 22 | 1 1 0 0 -1 23 | 1 -1 0 0 10 24 | 0 1 -2 0 0 25 | 1 1 -2 0 0 26 | 1 -1 2 0 1 27 | 1 1 0 -2 0 28 | 1 -1 0 2 1 29 | 0 0 0 30 | 31 | 32 | 33 | 1 34 | 7 5 35 | 1 1 0 0 -1 36 | 1 -1 0 0 10 37 | 0 1 -2 0 0 38 | 1 1 -2 0 0 39 | 1 -1 2 0 1 40 | 1 1 0 -2 0 41 | 1 -1 0 2 1 42 | 0 0 0 43 | 44 | 45 | 1 46 | j a b 47 | #-------- SCATTERING ------------- 48 | 0 # no scattering function 49 | 50 | -------------------------------------------------------------------------------- /test/rectangle.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/rectangle.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int n) 13 | { 14 | /* Scattering iterators. */ 15 | int c1; 16 | /* Original iterators. */ 17 | int i, j; 18 | for (c1=0;c1<=2*n;c1++) { 19 | for (i=max(c1-n,0);i<=min(c1,n);i++) { 20 | j = c1-i ; 21 | S1(i,c1-i) ; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/dot.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/dot.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int M, int N) 14 | { 15 | /* Original iterators. */ 16 | int i, j; 17 | for (j=1;j<=M;j++) { 18 | S1(0,j) ; 19 | } 20 | for (i=1;i<=N;i++) { 21 | for (j=1;j<=M;j++) { 22 | S2(i,j) ; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/pouchet.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./pouchet.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.02s. */ 2 | if (Ny >= 2) { 3 | for (c0=1;c0<=floord(Ny+4,2);c0++) { 4 | for (c1=max(ceild(c0+1,2),c0-1);c1<=min(floord(2*c0+Ny,4),c0);c1++) { 5 | if (c0 >= ceild(4*c1-Ny+1,2)) { 6 | for (c2=1;c2<=2;c2++) { 7 | S1((c0-c1),c1,(2*c0-2*c1),(-2*c0+4*c1),c2); 8 | S2((c0-c1),c1,(2*c0-2*c1),(-2*c0+4*c1-1),c2); 9 | } 10 | } 11 | if (2*c0 == 4*c1-Ny) { 12 | for (c2=1;c2<=2;c2++) { 13 | if (Ny%2 == 0) { 14 | if ((2*c0+3*Ny)%4 == 0) { 15 | S2(((2*c0-Ny)/4),((2*c0+Ny)/4),((2*c0-Ny)/2),(Ny-1),c2); 16 | } 17 | } 18 | } 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /test/reservoir/jacobi3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/jacobi3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ 2 | if ((M >= 1) && (N >= 3)) { 3 | for (c4=2;c4<=N-1;c4++) { 4 | for (c6=2;c6<=N-1;c6++) { 5 | S1(1,c4,c6); 6 | } 7 | } 8 | for (c2=3;c2<=2*M;c2++) { 9 | for (c4=2;c4<=N-1;c4++) { 10 | for (c6=2;c6<=N-1;c6++) { 11 | if (c2%2 == 0) { 12 | S1((c2/2),c4,c6); 13 | } 14 | } 15 | } 16 | for (c4=2;c4<=N-1;c4++) { 17 | for (c6=2;c6<=N-1;c6++) { 18 | if ((c2+1)%2 == 0) { 19 | S2(((c2-1)/2),c4,c6); 20 | } 21 | } 22 | } 23 | } 24 | for (c4=2;c4<=N-1;c4++) { 25 | for (c6=2;c6<=N-1;c6++) { 26 | S2(M,c4,c6); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/nul_basic1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from nul_basic1.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j) { hash(1); hash(i); hash(j); } 17 | 18 | void test(int M) 19 | { 20 | /* Original iterators. */ 21 | int i, j; 22 | if (M >= 0) { 23 | for (i=0;i<=M;i++) { 24 | if (i%2 == 0) { 25 | S1(i,(i/2)); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/stride.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from stride.cloog by CLooG 0.14.0-200-g26bdb56 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test() 14 | { 15 | /* Scattering iterators. */ 16 | int c1, c2; 17 | /* Original iterators. */ 18 | int i, j; 19 | for (c1=3;c1<=100;c1++) { 20 | if (c1 == 25) { 21 | S1(25); 22 | } 23 | if (c1%3 == 0) { 24 | S2(c1,c1/3); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/walters3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/walters3.cloog by CLooG 0.14.0-338-g99c7504 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(j,a,b) { hash(1); hash(j); hash(a); hash(b); } 11 | #define S2(j,a,b) { hash(2); hash(j); hash(a); hash(b); } 12 | 13 | void test() 14 | { 15 | /* Original iterators. */ 16 | int j, a, b; 17 | for (j=2;j<=8;j++) { 18 | if (j%2 == 0) { 19 | S1(j,j/2,j/2); 20 | S2(j,j/2,j/2); 21 | } 22 | } 23 | S2(10,5,5); 24 | } 25 | -------------------------------------------------------------------------------- /test/openscop/matmult.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./openscop/matmult.scop by CLooG 0.18.3 gmp bits in 0.01s. */ 2 | /* Useful macros. */ 3 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 4 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 5 | #define max(x,y) ((x) > (y) ? (x) : (y)) 6 | #define min(x,y) ((x) < (y) ? (x) : (y)) 7 | 8 | #ifdef TIME 9 | #define IF_TIME(foo) foo; 10 | #else 11 | #define IF_TIME(foo) 12 | #endif 13 | 14 | /* Scattering iterators. */ 15 | int c2, c4, c6; 16 | /* Original iterators. */ 17 | int i, j, k; 18 | 19 | for (c2=0;c2<=N-1;c2++) { 20 | for (c4=0;c4<=N-1;c4++) { 21 | C[c2][c4] = 0.0; 22 | for (c6=0;c6<=N-1;c6++) { 23 | C[c2][c4] = C[c2][c4] + A[c2][c6] * B[c6][c4]; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/youcefn.cloog: -------------------------------------------------------------------------------- 1 | # Optimal code is in fact : 2 | # 3 | # for (i=0;i<=M;i++) { 4 | # S1 ; 5 | # for (j=0;j<=N;j++) { 6 | # S2 ; 7 | # } 8 | # S3 ; 9 | # } 10 | 11 | # language: C 12 | c 13 | 14 | # parameters {n, m | n>=2 m>=n} 15 | 2 4 16 | 1 1 0 -2 17 | 1 -1 1 0 18 | 1 19 | n m 20 | 21 | 3 # Number of statements 22 | 23 | 1 24 | # {i | 0<=i<=n i==j} 25 | 3 6 26 | 1 1 0 0 0 -1 27 | 1 -1 0 1 0 0 28 | 0 1 -1 0 0 0 29 | 0 0 0 30 | 31 | 1 32 | # {i | 0<=i<=n i<=j<=n} 33 | 4 6 34 | 1 1 0 0 0 -1 35 | 1 -1 0 1 0 0 36 | 1 -1 1 0 0 0 37 | 1 0 -1 1 0 0 38 | 0 0 0 39 | 40 | 1 41 | # {i | 0<=i<=m j==n} 42 | 3 6 43 | 1 1 0 0 0 -1 44 | 1 -1 0 0 1 0 45 | 0 0 1 -1 0 0 46 | 0 0 0 47 | 0 48 | 49 | 0 # Scattering functions 50 | -------------------------------------------------------------------------------- /cmake/isl-config.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the isl library 2 | 3 | # ISL_FOUND - System has isl lib 4 | # ISL_INCLUDE_DIR - The isl include directory 5 | # ISL_LIBRARY - Library needed to use isl 6 | 7 | 8 | if (ISL_INCLUDE_DIR AND ISL_LIBRARY) 9 | # Already in cache, be silent 10 | set(ISL_FIND_QUIETLY TRUE) 11 | endif() 12 | 13 | find_path(ISL_INCLUDE_DIR NAMES isl/version.h) 14 | find_library(ISL_LIBRARY NAMES isl) 15 | 16 | if (ISL_LIBRARY AND ISL_INCLUDE_DIR) 17 | message(STATUS "Library isl found =) ${ISL_LIBRARY}") 18 | else() 19 | message(STATUS "Library isl not found =(") 20 | endif() 21 | 22 | include(FindPackageHandleStandardArgs) 23 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(ISL DEFAULT_MSG ISL_INCLUDE_DIR ISL_LIBRARY) 24 | 25 | mark_as_advanced(ISL_INCLUDE_DIR ISL_LIBRARY) 26 | -------------------------------------------------------------------------------- /test/guide.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/guide.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i) { hash(2); hash(i); } 12 | 13 | void test(int M, int N) 14 | { 15 | /* Original iterators. */ 16 | int i; 17 | for (i=1;i<=N;i++) { 18 | if (i >= M) { 19 | S1(i) ; 20 | } 21 | if (i <= min(2*M,M-1)) { 22 | S1(i) ; 23 | } 24 | } 25 | for (i=N+1;i<=2*N;i++) { 26 | S2(i) ; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/openscop/union.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./openscop/union.scop by CLooG 0.18.3 gmp bits in 0.01s. */ 2 | /* Useful macros. */ 3 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 4 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 5 | #define max(x,y) ((x) > (y) ? (x) : (y)) 6 | #define min(x,y) ((x) < (y) ? (x) : (y)) 7 | 8 | #ifdef TIME 9 | #define IF_TIME(foo) foo; 10 | #else 11 | #define IF_TIME(foo) 12 | #endif 13 | 14 | /* Scattering iterators. */ 15 | int c2, c4; 16 | /* Original iterators. */ 17 | int i, j; 18 | 19 | if (N >= 1) { 20 | for (c2=0;c2<=N-1;c2++) { 21 | for (c4=0;c4<=min(10,N-1);c4++) { 22 | C[c2+c4]+=A[c2]*B[c4]; 23 | } 24 | for (c4=20;c4<=N-1;c4++) { 25 | C[c2+c4]+=A[c2]*B[c4]; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/cholesky.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/cholesky.cloog by CLooG 0.14.0-136-gb91ef26 gmp bits in 0.04s. */ 2 | if (n >= 1) { 3 | if (n >= 2) { 4 | S1(1) ; 5 | S3(1) ; 6 | for (c3=2;c3<=n;c3++) { 7 | S4(1,c3) ; 8 | S6(1,c3) ; 9 | } 10 | } 11 | if (n == 1) { 12 | S1(1) ; 13 | S3(1) ; 14 | } 15 | for (c1=2;c1<=n-1;c1++) { 16 | S1(c1) ; 17 | for (c3=1;c3<=c1-1;c3++) { 18 | S2(c1,c3) ; 19 | } 20 | S3(c1) ; 21 | for (c3=c1+1;c3<=n;c3++) { 22 | S4(c1,c3) ; 23 | for (c5=1;c5<=c1-1;c5++) { 24 | S5(c1,c3,c5) ; 25 | } 26 | S6(c1,c3) ; 27 | } 28 | } 29 | if (n >= 2) { 30 | S1(n) ; 31 | for (c3=1;c3<=n-1;c3++) { 32 | S2(n,c3) ; 33 | } 34 | S3(n) ; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/min-2-1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/min-2-1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j,k) { hash(1); hash(i); hash(j); hash(k); } 11 | 12 | void test(int M, int N) 13 | { 14 | /* Original iterators. */ 15 | int i, j, k; 16 | if (M >= 0) { 17 | for (i=1;i<=N;i++) { 18 | for (j=0;j<=min(min(i,M),-i+N);j++) { 19 | for (k=0;k<=min(min(M,i),-i+N);k++) { 20 | S1(i,j,k) ; 21 | } 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/openscop/clay.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from clay.scop by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i) { hash(1); hash(i); } 17 | 18 | void test() 19 | { 20 | /* Scattering iterators. */ 21 | int __ii0; 22 | /* Original iterators. */ 23 | int i; 24 | for (__ii0=0;__ii0<=10;__ii0++) { 25 | for (i=4*__ii0;i<=min(41,4*__ii0+3);i++) { 26 | S1(i); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/published/PACT2004/youcefn.cloog: -------------------------------------------------------------------------------- 1 | # Optimal code is in fact : 2 | # 3 | # for (i=0;i<=M;i++) { 4 | # S1 ; 5 | # for (j=0;j<=N;j++) { 6 | # S2 ; 7 | # } 8 | # S3 ; 9 | # } 10 | 11 | # language: C 12 | c 13 | 14 | # parameters {n, m | n>=2 m>=n} 15 | 2 4 16 | 1 1 0 -2 17 | 1 -1 1 0 18 | 1 19 | n m 20 | 21 | 3 # Number of statements 22 | 23 | 1 24 | # {i | 0<=i<=n i==j} 25 | 3 6 26 | 1 1 0 0 0 -1 27 | 1 -1 0 1 0 0 28 | 0 1 -1 0 0 0 29 | 0 0 0 30 | 31 | 1 32 | # {i | 0<=i<=n i<=j<=n} 33 | 4 6 34 | 1 1 0 0 0 -1 35 | 1 -1 0 1 0 0 36 | 1 -1 1 0 0 0 37 | 1 0 -1 1 0 0 38 | 0 0 0 39 | 40 | 1 41 | # {i | 0<=i<=m j==n} 42 | 3 6 43 | 1 1 0 0 0 -1 44 | 1 -1 0 0 1 0 45 | 0 0 1 -1 0 0 46 | 0 0 0 47 | 0 48 | 49 | 0 # Scattering functions 50 | -------------------------------------------------------------------------------- /test/stride4.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from stride4.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i0,i1) { hash(1); hash(i0); hash(i1); } 17 | 18 | void test(int t) 19 | { 20 | /* Original iterators. */ 21 | int i0, i1; 22 | if ((t >= 0) && (t <= 15)) { 23 | for (i0=0;i0<=99;i0++) { 24 | if ((15*i0+t)%16 == 0) { 25 | S1(i0,t); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/block2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/block2.cloog by CLooG 0.14.0-302-g309b32c gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | #define S3(i,j) { hash(3); hash(i); hash(j); } 13 | 14 | void test() 15 | { 16 | /* Scattering iterators. */ 17 | int c0, c1; 18 | /* Original iterators. */ 19 | int i, j; 20 | for (c0=0;c0<=9;c0++) { 21 | S1(c0,1); 22 | S3(c0,1); 23 | S2(c0,1); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/isl/mod4.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from mod4.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i) { hash(1); hash(i); } 17 | 18 | void test(int M, int N) 19 | { 20 | /* Original iterators. */ 21 | int i; 22 | if (M%11 <= 6) { 23 | if (N%5 <= 2) { 24 | if (M >= -N) { 25 | for (i=0;i<=M+N;i++) { 26 | S1(i); 27 | } 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/lu.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter n 5 | 1 3 6 | # n 1 7 | 1 0 1 8 | 1 9 | n 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # {i, j | 1<=i<=n; i+1<=j<=n} 15 | 4 5 16 | # i j n 1 17 | 1 1 0 0 -1 18 | 1 -1 0 1 0 19 | 1 -1 1 0 -1 20 | 1 0 -1 1 0 21 | 0 0 0 22 | 23 | 1 24 | # {i, j, k | 1<=i<=n; i+1<=j<=n i+1<=k<=n} 25 | 6 6 26 | # i j k n 1 27 | 1 1 0 0 0 -1 28 | 1 -1 0 0 1 0 29 | 1 -1 1 0 0 -1 30 | 1 0 -1 0 1 0 31 | 1 -1 0 1 0 -1 32 | 1 0 0 -1 1 0 33 | 0 0 0 34 | 0 35 | 36 | 2 # Scattering functions 37 | # Et les instructions de chunking... 38 | 2 7 39 | # c1 c2 i j n 1 40 | 0 1 0 -1 0 0 0 41 | 0 0 1 0 0 -1 0 42 | 43 | 2 8 44 | # c1 c2 i j k n 1 45 | 0 1 0 0 0 -1 0 0 46 | 0 0 1 0 -1 0 0 0 47 | 0 48 | -------------------------------------------------------------------------------- /test/openscop/empty.scop: -------------------------------------------------------------------------------- 1 | 2 | 3 | # =============================================== Global 4 | # Language 5 | C 6 | 7 | # Context 8 | CONTEXT 9 | 0 2 0 0 0 0 10 | 11 | # Parameter names are not provided 12 | 0 13 | 14 | # One statement 15 | 1 16 | 17 | # =============================================== Statement 1 18 | # Number of relations describing the statement 19 | 0 20 | 21 | # ---------------------------------------------- 1.1 Domain 22 | # NULL Domain 23 | 24 | # ---------------------------------------------- 1.2 Scattering 25 | # NULL Scattering 26 | 27 | # ---------------------------------------------- 1.3 Access 28 | # NULL Access 29 | 30 | # ---------------------------------------------- 1.4 Body 31 | # Statement body is not provided 32 | 0 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /test/multi-stride2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from multi-stride2.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j,k) { hash(1); hash(i); hash(j); hash(k); } 17 | 18 | void test() 19 | { 20 | /* Original iterators. */ 21 | int i, j, k; 22 | for (i=0;i<=100;i++) { 23 | if ((i+1)%2 == 0) { 24 | if ((i+1)%3 == 0) { 25 | S1(i,((i-1)/2),((i-2)/3)); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/non_optimal/deuxpts.cloog: -------------------------------------------------------------------------------- 1 | 2 | 3 | #----------------------SCoP NO. 49 4 | 5 | #-------------------CONTEXT------------------------ 6 | c # language is c 7 | 1 # Context (no constarints on parameters) 8 | 1 3 # 1 lines and 10 coloumns 9 | # NUM1 1 10 | 0 0 0 11 | 12 | 0 13 | 14 | #---------------------STATEMENTS-------------------- 15 | 2 #Number of Statements 16 | 17 | 1 #STMT 1 at line no. 2063 has 1 domain 18 | # Domain 1 19 | 1 3 20 | # NUM1 1 21 | 0 0 0 22 | 0 0 0 23 | 24 | 1 #STMT 7 at line no. 2075 has 1 domain 25 | # Domain 1 26 | 1 3 27 | # NUM1 1 28 | 0 0 0 29 | 0 0 0 30 | 31 | 0 32 | 33 | #---------------------SCATTERING FUNCTIONS-------------------- 34 | 0 #Scattering functions 35 | 36 | -------------------------------------------------------------------------------- /test/nul_lcpc.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter n 5 | 3 5 6 | # m n p 1 7 | 1 1 -1 0 -1 8 | 1 0 -1 1 -1 9 | 0 0 1 0 -6 10 | 1 11 | m n p 12 | 13 | 2 # Number of statements 14 | 15 | 1 16 | # {i, j, k | i=2*k+1; 1<=i<=m; 1<=j<=p} 17 | 5 8 18 | # i k j m n p 1 19 | 0 1 -2 0 0 0 0 -1 # i=2*k+1 20 | 1 1 0 0 0 0 0 -1 # 1<=i 21 | 1 -1 0 0 1 0 0 0 # i<=m 22 | 1 0 0 1 0 0 0 -1 # 1<=j 23 | 1 0 0 -1 0 0 1 0 # j<=p 24 | 0 0 0 25 | 26 | 1 27 | # {i, j, k | i=2*k+1; 1<=i<=n; 1<=j<=i} 28 | 5 8 29 | # i k j m n p 1 30 | 0 1 -2 0 0 0 0 -1 # i=2*k+1 31 | 1 1 0 0 0 0 0 -1 # 1<=i 32 | 1 -1 0 0 0 1 0 0 # i<=n 33 | 1 0 0 1 0 0 0 -1 # 1<=j 34 | 1 1 0 -1 0 0 0 0 # j<=i 35 | 0 0 0 36 | 1 37 | i k j 38 | 39 | 0 # Scattering functions 40 | -------------------------------------------------------------------------------- /test/uday_scalars.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/uday_scalars.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(j,l,m) { hash(1); hash(j); hash(l); hash(m); } 11 | #define S2(j,l,m) { hash(2); hash(j); hash(l); hash(m); } 12 | 13 | void test(int n) 14 | { 15 | /* Scattering iterators. */ 16 | int p3; 17 | /* Original iterators. */ 18 | int j, l, m; 19 | for (p3=0;p3<=n;p3++) { 20 | S1(p3,0,0) ; 21 | } 22 | for (p3=0;p3<=n;p3++) { 23 | S2(0,p3,0) ; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /test/constbound.cloog: -------------------------------------------------------------------------------- 1 | # CLooG script generated automatically by PLUTO 2 | # language: C 3 | c 4 | 5 | # Context 6 | 0 2 7 | 8 | 1 9 | 10 | 11 | # Number of statements 12 | 2 13 | 14 | 1 # of domains 15 | 6 5 16 | 1 0 1 0 0 17 | 1 0 -1 0 9999 18 | 1 0 0 1 0 19 | 1 0 1 -1 0 20 | 1 -50 1 0 0 21 | 1 50 -1 0 24 22 | 0 0 0 23 | 24 | 1 25 | 6 5 26 | 1 0 1 0 0 27 | 1 0 -1 0 9999 28 | 1 0 0 1 0 29 | 1 0 1 -1 0 30 | 1 -50 1 0 -25 31 | 1 50 -1 0 49 32 | 0 0 0 33 | 34 | 0 35 | 36 | # of scattering functions 37 | 2 38 | 39 | 4 9 40 | 0 1 0 0 0 -1 0 0 0 41 | 0 0 1 0 0 0 0 0 0 42 | 0 0 0 1 0 0 -1 0 0 43 | 0 0 0 0 1 0 0 -1 0 44 | 45 | 4 9 46 | 0 1 0 0 0 -1 0 0 0 47 | 0 0 1 0 0 0 0 0 -1 48 | 0 0 0 1 0 0 -1 0 0 49 | 0 0 0 0 1 0 0 -1 0 50 | 51 | # we will set the scattering dimension names 52 | 4 53 | t0 t1 t2 t3 54 | -------------------------------------------------------------------------------- /test/isl/mod3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from mod3.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j) { hash(1); hash(i); hash(j); } 17 | 18 | void test(int h0) 19 | { 20 | /* Original iterators. */ 21 | int i, j; 22 | for (i=max(0,32*h0-1991);i<=min(999,32*h0+31);i++) { 23 | if ((63*i+32*h0+31)%64 <= 62) { 24 | for (j=0;j<=999;j++) { 25 | S1(i,j); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/levenshtein-1-2-3.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./levenshtein-1-2-3.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ 2 | S1(0,0); 3 | S2(1,0); 4 | S3(1,1); 5 | for (i=2;i<=N;i++) { 6 | S2(i,0); 7 | for (j=1;j<=i-1;j++) { 8 | S6(i,j); 9 | } 10 | S3(i,i); 11 | } 12 | S7((N+1),0); 13 | for (j=1;j<=N;j++) { 14 | S6((N+1),j); 15 | S8((N+1),j); 16 | } 17 | for (i=N+2;i<=2*M-N-2;i++) { 18 | j = floord(i-N-1,2); 19 | S7(i,j); 20 | if ((i+N)%2 == 0) { 21 | S5(i,((i-N)/2)); 22 | S8(i,((i-N)/2)); 23 | } 24 | for (j=ceild(i-N+1,2);j<=floord(i+N-1,2);j++) { 25 | S6(i,j); 26 | S8(i,j); 27 | } 28 | if ((i+N)%2 == 0) { 29 | S4(i,((i+N)/2)); 30 | S8(i,((i+N)/2)); 31 | } 32 | } 33 | for (i=2*M-N-1;i<=2*M-2;i++) { 34 | for (j=i-M+1;j<=M-1;j++) { 35 | S6(i,j); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test/levenshtein-1-2-3f.f: -------------------------------------------------------------------------------- 1 | ! Generated from ./levenshtein-1-2-3f.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.00s. 2 | S1(0,0) 3 | S2(1,0) 4 | S3(1,1) 5 | DO i=2, N 6 | S2(i,0) 7 | DO j=1, i-1 8 | S6(i,j) 9 | END DO 10 | S3(i,i) 11 | END DO 12 | S7((N+1),0) 13 | DO j=1, N 14 | S6((N+1),j) 15 | S8((N+1),j) 16 | END DO 17 | DO i=N+2, 2*M-N-2 18 | j = FLOOR(REAL(i-N-1)/REAL(2)) 19 | S7(i,j) 20 | IF (MOD(i+N, 2) == 0) THEN 21 | S5(i,((i-N)/2)) 22 | S8(i,((i-N)/2)) 23 | END IF 24 | DO j=CEILING(REAL(i-N+1)/REAL(2)), FLOOR(REAL(i+N-1)/REAL(2)) 25 | S6(i,j) 26 | S8(i,j) 27 | END DO 28 | IF (MOD(i+N, 2) == 0) THEN 29 | S4(i,((i+N)/2)) 30 | S8(i,((i+N)/2)) 31 | END IF 32 | END DO 33 | DO i=2*M-N-1, 2*M-2 34 | DO j=i-M+1, M-1 35 | S6(i,j) 36 | END DO 37 | END DO 38 | -------------------------------------------------------------------------------- /test/nul_ispdc.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameter n 5 | 3 5 6 | # m n p 1 7 | 1 1 -1 0 -1 8 | 1 0 -1 1 -1 9 | 0 0 1 0 -6 10 | 1 11 | m n p 12 | 13 | 2 # Number of statements 14 | 15 | 1 16 | # {i, j, k | i=2*k+1; 1<=i<=m; 1<=j<=p} 17 | 5 8 18 | # i k j m n p 1 19 | 0 1 -2 0 0 0 0 -1 # i=2*k+1 20 | 1 1 0 0 0 0 0 -1 # 1<=i 21 | 1 -1 0 0 1 0 0 0 # i<=m 22 | 1 0 0 1 0 0 0 -1 # 1<=j 23 | 1 0 0 -1 0 0 1 0 # j<=p 24 | 0 0 0 25 | 26 | 1 27 | # {i, j, k | i=2*k+1; 1<=i<=n; 1<=j<=7-i} 28 | 5 8 29 | # i k j m n p 1 30 | 0 1 -2 0 0 0 0 -1 # i=2*k+1 31 | 1 1 0 0 0 0 0 -1 # 1<=i 32 | 1 -1 0 0 0 1 0 0 # i<=n 33 | 1 0 0 1 0 0 0 -1 # 1<=j 34 | 1 -1 0 -1 0 0 0 7 # j<=7-i 35 | 0 0 0 36 | 1 37 | i k j 38 | 39 | 0 # Scattering functions 40 | -------------------------------------------------------------------------------- /test/iftest2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/iftest2.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int M, int N) 13 | { 14 | /* Original iterators. */ 15 | int i, j; 16 | if (M >= 1) { 17 | for (i=1;i<=N;i++) { 18 | for (j=1;j<=M;j++) { 19 | if (i <= 2*M) { 20 | S1(i,j) ; 21 | } 22 | if (i >= max(M,2*M+1)) { 23 | S1(i,j) ; 24 | } 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /test/reservoir/bastoul3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from bastoul3.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j,k) { hash(1); hash(i); hash(j); hash(k); } 17 | 18 | void test() 19 | { 20 | /* Original iterators. */ 21 | int i, j, k; 22 | for (i=3;i<=9;i++) { 23 | for (j=max(1,i-6);j<=min(3,i-2);j++) { 24 | if ((i+j)%2 == 0) { 25 | S1(i,j,((i-j)/2)); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore objects and archives. 2 | *.[oa] 3 | # library description files 4 | *.lo 5 | *.la 6 | 7 | # Ignore some directories. Already tracked files will still be tracked. It 8 | # is possible to force tracking of a file within these directories if necessary. 9 | m4/ 10 | .deps/ 11 | .libs/ 12 | autoconf/ 13 | autom4te.cache/ 14 | 15 | # Ignore build utilities. 16 | aclocal.m4 17 | libtool 18 | configure 19 | Makefile 20 | Makefile.in 21 | 22 | # Ignore logs. 23 | *.log 24 | *.status 25 | .dirstamp 26 | 27 | # Ignore version files. 28 | version.[ch] 29 | genversion.sh 30 | 31 | # Ignore build results. 32 | cloog 33 | !cloog/ 34 | cloog-*-uninstalled.* 35 | cloog-*.pc* 36 | 37 | # Miscellaneous. 38 | doc/gitversion.texi 39 | test/generate_test* 40 | test/test_main* 41 | test/test_test* 42 | test/temp_generated* 43 | -------------------------------------------------------------------------------- /test/merge.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/merge.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i) { hash(2); hash(i); } 12 | #define S3(i) { hash(3); hash(i); } 13 | 14 | void test() 15 | { 16 | /* Scattering iterators. */ 17 | int c1; 18 | /* Original iterators. */ 19 | int i; 20 | for (c1=0;c1<=10;c1++) { 21 | if (c1 == 0) { 22 | S1(0) ; 23 | } 24 | if (c1 >= 2) { 25 | S2(c1) ; 26 | } 27 | S3(c1) ; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/wavefront.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/wavefront.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int n, int m) 13 | { 14 | /* Scattering iterators. */ 15 | int c1, c2; 16 | /* Original iterators. */ 17 | int i, j; 18 | if ((n >= 1) && (m >= 1)) { 19 | for (c1=2;c1<=n+m;c1++) { 20 | for (c2=max(1,c1-m);c2<=min(n,c1-1);c2++) { 21 | j = c1-c2 ; 22 | S1(c2,c1-c2) ; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/donotsimp.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/donotsimp.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int M) 14 | { 15 | /* Scattering iterators. */ 16 | int c2, c4; 17 | /* Original iterators. */ 18 | int i, j; 19 | for (c2=1;c2<=10;c2++) { 20 | for (c4=1;c4<=c2;c4++) { 21 | S1(c2,c4) ; 22 | } 23 | for (c4=11;c4<=M;c4++) { 24 | S2(c2,c4) ; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/reservoir/stride.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from stride.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j) { hash(1); hash(i); hash(j); } 17 | 18 | void test(int M) 19 | { 20 | /* Scattering iterators. */ 21 | int c2; 22 | /* Original iterators. */ 23 | int i, j; 24 | if (M >= 2) { 25 | for (c2=2;c2<=M;c2++) { 26 | if ((c2+5)%7 == 0) { 27 | S1(c2,((c2-2)/7)); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/reservoir/stride2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from stride2.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j) { hash(1); hash(i); hash(j); } 17 | 18 | void test(int M) 19 | { 20 | /* Scattering iterators. */ 21 | int c2; 22 | /* Original iterators. */ 23 | int i, j; 24 | if (M >= 0) { 25 | for (c2=0;c2<=M;c2++) { 26 | if ((c2+5)%7 == 0) { 27 | S1(c2,((c2-2)/7)); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/double.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/double.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | #define S3(i,j) { hash(3); hash(i); hash(j); } 13 | #define S4(i) { hash(4); hash(i); } 14 | 15 | void test(int M, int N) 16 | { 17 | /* Original iterators. */ 18 | int i, j; 19 | for (i=0;i<=M;i++) { 20 | S1(i) ; 21 | for (j=0;j<=N;j++) { 22 | S2(i,j) ; 23 | S3(i,j) ; 24 | } 25 | S4(i) ; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/esced.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/esced.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int n, int m) 14 | { 15 | /* Original iterators. */ 16 | int i, j; 17 | if (n >= 1) { 18 | for (i=1;i<=m;i++) { 19 | S1(i) ; 20 | for (j=1;j<=n;j++) { 21 | S2(i,j) ; 22 | } 23 | } 24 | } 25 | if (n <= 0) { 26 | for (i=1;i<=m;i++) { 27 | S1(i) ; 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/nul_basic2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from nul_basic2.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j) { hash(1); hash(i); hash(j); } 17 | #define S2(i,j) { hash(2); hash(i); hash(j); } 18 | 19 | void test(int n) 20 | { 21 | /* Original iterators. */ 22 | int i, j; 23 | for (i=1;i<=n;i++) { 24 | if (i%4 == 0) { 25 | S2(i,(i/4)); 26 | } 27 | if (i%2 == 0) { 28 | S1(i,(i/2)); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/reservoir/jacobi2.cloog: -------------------------------------------------------------------------------- 1 | # Language 2 | c 3 | 4 | # Context 5 | 6 | 2 3 7 | 1 1 -1 8 | 1 0 1 9 | 0 10 | 11 | # Number of statments 12 | 1 13 | 14 | 1 15 | # { (i,j,k) | i >= 0, -i+k-1 >= 0, j >= 0, -j+k-1 >= 0, 1 >= 0 } 16 | 17 | 5 5 18 | 1 1 0 0 0 19 | 1 -1 0 1 -1 20 | 1 0 1 0 0 21 | 1 0 -1 1 -1 22 | 1 0 0 0 1 23 | 24 | 0 0 0 25 | 0 26 | # Scattering functions 27 | 1 28 | 29 | 6 10 30 | 0 1 0 0 0 0 0 0 0 0 31 | 0 0 1 0 0 0 -1 0 0 0 32 | 0 0 0 1 0 0 0 0 0 0 33 | 0 0 0 0 1 0 0 -1 0 0 34 | 0 0 0 0 0 1 0 0 0 0 35 | 1 0 0 0 0 0 0 0 0 1 36 | 37 | 0 38 | -------------------------------------------------------------------------------- /test/stride3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from stride3.cloog by CLooG 0.20.0-5e05a27 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i) { hash(1); hash(i); } 17 | 18 | void test(int m, int n) 19 | { 20 | /* Scattering iterators. */ 21 | int p1; 22 | /* Original iterators. */ 23 | int i; 24 | if ((m <= n) && (n >= 1)) { 25 | for (p1=max(50,50*m);p1<=50*n;p1++) { 26 | if (p1%50 == 0) { 27 | S1((p1/50)); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/equality.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/equality.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i0,i1) { hash(1); hash(i0); hash(i1); } 11 | #define S2(i0,i1) { hash(2); hash(i0); hash(i1); } 12 | 13 | void test() 14 | { 15 | /* Original iterators. */ 16 | int i0, i1; 17 | for (i0=0;i0<=5;i0++) { 18 | for (i1=ceild(4*i0,5);i1<=floord(6*i0+20,5);i1++) { 19 | if (2*i0 == i1) { 20 | S1(i0,i1) ; 21 | } 22 | if (i1 == 4) { 23 | S2(i0,i1) ; 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/reservoir/cholesky2.c: -------------------------------------------------------------------------------- 1 | /* Generated from ./reservoir/cholesky2.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.01s. */ 2 | if (M >= 1) { 3 | if (M >= 2) { 4 | S1(1); 5 | } 6 | for (c2=2;c2<=min(3,M);c2++) { 7 | S2(1,c2); 8 | } 9 | if (M == 1) { 10 | S1(1); 11 | } 12 | for (c2=4;c2<=3*M-4;c2++) { 13 | if ((c2+1)%3 == 0) { 14 | S1(((c2+1)/3)); 15 | } 16 | for (c4=ceild(c2+2,3);c4<=min(M,c2-2);c4++) { 17 | for (c6=ceild(c2-c4+2,2);c6<=min(c4,c2-c4);c6++) { 18 | S3((c2-c4-c6+1),c4,c6); 19 | } 20 | } 21 | for (c4=ceild(c2+4,3);c4<=min(M,c2);c4++) { 22 | if ((c2+c4)%2 == 0) { 23 | S2(((c2-c4+2)/2),c4); 24 | } 25 | } 26 | } 27 | for (c2=max(2*M,3*M-3);c2<=3*M-2;c2++) { 28 | S3((c2-2*M+1),M,M); 29 | } 30 | if (M >= 2) { 31 | S1(M); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/reservoir/loechner3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/loechner3.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j,k) { hash(1); hash(i); hash(j); hash(k); } 11 | 12 | void test(int M) 13 | { 14 | /* Scattering iterators. */ 15 | int c2, c4, c6; 16 | /* Original iterators. */ 17 | int i, j, k; 18 | for (c2=1;c2<=M;c2++) { 19 | for (c4=2;c4<=c2+M;c4++) { 20 | for (c6=max(1,-c2+c4);c6<=min(M,c4-1);c6++) { 21 | k = c4-c6 ; 22 | S1(c2,c6,c4-c6) ; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/reservoir/fusion1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/fusion1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i) { hash(2); hash(i); } 12 | #define S3(i) { hash(3); hash(i); } 13 | 14 | void test(int M) 15 | { 16 | /* Scattering iterators. */ 17 | int c2; 18 | /* Original iterators. */ 19 | int i; 20 | for (c2=0;c2<=M;c2++) { 21 | S1(c2) ; 22 | } 23 | for (c2=1;c2<=M;c2++) { 24 | S2(c2) ; 25 | } 26 | for (c2=0;c2<=M;c2++) { 27 | S3(c2) ; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/dot2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/dot2.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int M, int N) 14 | { 15 | /* Original iterators. */ 16 | int i, j; 17 | for (i=1;i<=min(M,N);i++) { 18 | S1(i) ; 19 | for (j=1;j<=M;j++) { 20 | S2(i,j) ; 21 | } 22 | } 23 | for (i=N+1;i<=M;i++) { 24 | S1(i) ; 25 | } 26 | for (i=M+1;i<=N;i++) { 27 | for (j=1;j<=M;j++) { 28 | S2(i,j) ; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/levenshtein-1-2-3f.c: -------------------------------------------------------------------------------- 1 | ! Generated from ./test/levenshtein-1-2-3f.cloog by CLooG v1.0.0 64 bits in 0.03s. 2 | ! CLooG asked for 164 KBytes. 3 | S1(i = 0,j = 0) 4 | S2(i = 1,j = 0) 5 | S3(i = 1,j = 1) 6 | DO i=2, N 7 | S2(j = 0) 8 | DO j=1, i-1 9 | S6 10 | END DO 11 | S3(j = i) 12 | END DO 13 | i = N+1 14 | S7(j = 0) 15 | DO j=1, N 16 | S6 17 | S8 18 | END DO 19 | DO i=N+2, 2*M-N-2 20 | DO j=CEILING(REAL(i-N-2)/REAL(2)), FLOOR(REAL(i-N-1)/REAL(2)) 21 | S7 22 | END DO 23 | IF (MOD(i-N,2) == 0) THEN 24 | j = (i-N)/2 25 | S5 26 | S8 27 | END IF 28 | IF (MOD(i+N,2) == 0) THEN 29 | j = (i+N)/2 30 | S4 31 | S8 32 | END IF 33 | DO j=CEILING(REAL(i-N+1)/REAL(2)), FLOOR(REAL(i+N-1)/REAL(2)) 34 | S6 35 | S8 36 | END DO 37 | END DO 38 | DO i=2*M-N-1, 2*M-2 39 | DO j=i-M+1, M-1 40 | S6 41 | END DO 42 | END DO 43 | -------------------------------------------------------------------------------- /test/reservoir/loechner5.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/loechner5.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.02s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j,k,l) { hash(1); hash(i); hash(j); hash(k); hash(l); } 11 | 12 | void test(int M) 13 | { 14 | /* Scattering iterators. */ 15 | int c2, c4, c6, c8; 16 | /* Original iterators. */ 17 | int i, j, k, l; 18 | for (c2=1;c2<=M;c2++) { 19 | for (c4=1;c4<=M;c4++) { 20 | for (c6=1;c6<=M;c6++) { 21 | for (c8=1;c8<=M;c8++) { 22 | S1(c4,c6,c2,c8) ; 23 | } 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/infinite2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from infinite2.cloog by CLooG 0.20.0-0e868c5 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S0 { hash(0); } 17 | #define S1(i) { hash(1); hash(i); } 18 | #define S2(i,j) { hash(2); hash(i); hash(j); } 19 | 20 | void test(int M, int N) 21 | { 22 | /* Original iterators. */ 23 | int i, j; 24 | for (i=1;i<=N;i++) { 25 | S1(i); 26 | for (j=1;j<=M;j++) { 27 | S2(i,j); 28 | } 29 | } 30 | for (i=N+1;i<=1000+N+1;i++) { 31 | S1(i); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /examples/example/example.c: -------------------------------------------------------------------------------- 1 | /* This is a very simple example of how to use the CLooGLib inside your 2 | * programs. You should compile it by typing 'make' (after edition of the 3 | * makefile), then test it for instance by typing 4 | * 'more FILE.cloog | ./example' (or example.exe under Cygwin). 5 | */ 6 | 7 | # include 8 | # include 9 | 10 | int main() 11 | { 12 | CloogState *state; 13 | CloogInput *input; 14 | CloogOptions * options ; 15 | struct clast_stmt *root; 16 | 17 | state = cloog_state_malloc(); 18 | options = cloog_options_malloc(state); 19 | input = cloog_input_read(stdin, options); 20 | 21 | root = cloog_clast_create_from_input(input, options); 22 | clast_pprint(stdout, root, 0, options); 23 | 24 | cloog_clast_free(root); 25 | cloog_options_free(options) ; 26 | cloog_state_free(state); 27 | 28 | return 0 ; 29 | } 30 | -------------------------------------------------------------------------------- /test/elimination.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # One parameter : n 5 | 1 3 6 | # n 1 7 | 1 0 1 8 | # We want to set the parameter names... 9 | 1 10 | # and 'n' is the name of the unique parameter 11 | n 12 | 13 | 2 # Number of statements: 2. 14 | 15 | 1 16 | # {i, j | 1<=i<=n-1; i+1<=j<=n} 17 | 4 5 18 | # i j n 1 19 | 1 1 0 0 -1 20 | 1 -1 0 1 -1 21 | 1 -1 1 0 -1 22 | 1 0 -1 1 0 23 | 0 0 0 24 | 25 | 1 26 | # {i, j, k | 1<=i<=n-1; i+1<=j<=n i+1<=k<=n} 27 | 6 6 28 | # i j k n 1 29 | 1 1 0 0 0 -1 30 | 1 -1 0 0 1 -1 31 | 1 -1 1 0 0 -1 32 | 1 0 -1 0 1 0 33 | 1 -1 0 1 0 -1 34 | 1 0 0 -1 1 0 35 | 0 0 0 36 | # We want to let CLooG set the iterator names. 37 | 0 38 | 39 | 40 | 2 41 | # Scattering functions 42 | 1 6 43 | # c1 i j n 1 44 | 0 1 -1 0 0 0 45 | 46 | 1 7 47 | # c1 i j k n 1 48 | 0 1 0 0 -1 0 0 49 | 1 50 | p1 51 | 52 | -------------------------------------------------------------------------------- /test/reservoir/stride.cloog: -------------------------------------------------------------------------------- 1 | # 2 | # Stride-bug: 3 | # 4 | # for (i = 2; i <= N; i+=7) { 5 | # S(i); 6 | # 7 | # becomes: 8 | # 9 | # for (i = 5; i <= N; i+=7) { 10 | # S(i); 11 | 12 | # Language 13 | c 14 | 15 | # Context 16 | 17 | 1 3 18 | 1 0 1 19 | 0 20 | 21 | # Number of statements 22 | 1 23 | 24 | 1 25 | 26 | 4 5 27 | 0 1 -7 0 -2 28 | 1 1 0 0 -2 29 | 1 -1 0 1 0 30 | 1 0 0 0 1 31 | 32 | 0 0 0 33 | 0 34 | # Scattering functions 35 | 1 36 | 37 | 6 10 38 | 0 1 0 0 0 0 0 0 0 0 39 | 0 0 1 0 0 0 -1 0 0 0 40 | 0 0 0 1 0 0 0 0 0 0 41 | 0 0 0 0 1 0 0 0 0 0 42 | 0 0 0 0 0 1 0 0 0 0 43 | 1 0 0 0 0 0 0 0 0 1 44 | 45 | 0 46 | -------------------------------------------------------------------------------- /test/walters2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from /home/skimo/git/cloog/test/walters2.cloog by CLooG 0.14.0-227-g08f253a gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(j,i) { hash(1); hash(j); hash(i); } 11 | #define S2(j,i) { hash(2); hash(j); hash(i); } 12 | 13 | void test() 14 | { 15 | /* Original iterators. */ 16 | int j, i; 17 | for (i=0;i<=51;i++) { 18 | S2(0,i); 19 | } 20 | for (j=1;j<=24;j++) { 21 | S2(j,0); 22 | for (i=1;i<=50;i++) { 23 | S1(j,i); 24 | } 25 | S2(j,51); 26 | } 27 | for (i=0;i<=51;i++) { 28 | if (i >= 0) { 29 | S2(25,i); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /test/reservoir/pingali2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/pingali2.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int M) 14 | { 15 | /* Scattering iterators. */ 16 | int c2, c4; 17 | /* Original iterators. */ 18 | int i, j; 19 | for (c2=1;c2<=M;c2++) { 20 | for (c4=1;c4<=M;c4++) { 21 | S1(c2,c4) ; 22 | } 23 | } 24 | for (c2=1;c2<=M;c2++) { 25 | for (c4=1;c4<=M;c4++) { 26 | S2(c2,c4) ; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/reservoir/pingali4.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/pingali4.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int M) 14 | { 15 | /* Scattering iterators. */ 16 | int c2, c4; 17 | /* Original iterators. */ 18 | int i, j; 19 | for (c2=1;c2<=M;c2++) { 20 | for (c4=1;c4<=M;c4++) { 21 | S1(c2,c4) ; 22 | } 23 | } 24 | for (c2=1;c2<=M;c2++) { 25 | for (c4=1;c4<=M;c4++) { 26 | S2(c2,c4) ; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/non_optimal/nul_complex1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./non_optimal/nul_complex1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | 12 | void test(int n) 13 | { 14 | /* Scattering iterators. */ 15 | int c1, c2; 16 | /* Original iterators. */ 17 | int i, j; 18 | for (c1=0;c1<=5*n;c1++) { 19 | for (c2=max(c1-n,ceild(2*c1,3));c2<=min(c1,floord(2*c1+2*n,3));c2++) { 20 | if (c2%2 == 0) { 21 | i = (-2*c1+3*c2)/2 ; 22 | j = c1-c2 ; 23 | S1((-2*c1+3*c2)/2,c1-c2) ; 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /test/forwardsub-1-1-2.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/forwardsub-1-1-2.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | #define S3(i,j) { hash(3); hash(i); hash(j); } 13 | #define S4(i,j) { hash(4); hash(i); hash(j); } 14 | 15 | void test(int M) 16 | { 17 | /* Original iterators. */ 18 | int i, j; 19 | S3(1,1) ; 20 | S1(2,1) ; 21 | S4(2,2) ; 22 | for (i=3;i<=M;i++) { 23 | S1(i,1) ; 24 | for (j=2;j<=i-1;j++) { 25 | S2(i,j) ; 26 | } 27 | S4(i,i) ; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/openscop/union.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from union.scop by CLooG 0.20.0-bb9d408 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j) { hash(1); hash(i); hash(j); } 17 | 18 | void test(int N) 19 | { 20 | /* Scattering iterators. */ 21 | int c2, c4; 22 | /* Original iterators. */ 23 | int i, j; 24 | if (N >= 1) { 25 | for (c2=0;c2<=N-1;c2++) { 26 | for (c4=0;c4<=min(10,N-1);c4++) { 27 | S1(c2,c4); 28 | } 29 | for (c4=20;c4<=N-1;c4++) { 30 | S1(c2,c4); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/multi-mm-1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/multi-mm-1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int M, int N) 14 | { 15 | /* Original iterators. */ 16 | int i, j; 17 | for (i=0;i<=N;i++) { 18 | for (j=0;j<=i;j++) { 19 | S1(i,j) ; 20 | S2(i,j) ; 21 | } 22 | } 23 | for (i=N+1;i<=M;i++) { 24 | for (j=0;j<=N;j++) { 25 | S1(i,j) ; 26 | S2(i,j) ; 27 | } 28 | for (j=N+1;j<=i;j++) { 29 | S1(i,j) ; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /test/union.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/union.cloog by CLooG 0.14.0-277-g62f7d82 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | 12 | void test(int M) 13 | { 14 | /* Scattering iterators. */ 15 | int c1; 16 | /* Original iterators. */ 17 | int i; 18 | if (M <= -1) { 19 | for (c1=0;c1<=100;c1++) { 20 | S1(c1); 21 | } 22 | } 23 | if (M >= 1) { 24 | if (M >= 11) { 25 | for (c1=-100;c1<=0;c1++) { 26 | S1(-c1); 27 | } 28 | } 29 | if (M <= 10) { 30 | for (c1=0;c1<=100;c1++) { 31 | S1(c1); 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test/guide.cloog: -------------------------------------------------------------------------------- 1 | # Language is C 2 | c 3 | 4 | # The context (no constraints on parameters) 5 | 1 4 # 1 lines and 4 columns 6 | # m n 1 7 | 1 0 0 0 # 0 >= 0, always true 8 | 0 # CLooG will set parameters names automatically 9 | 10 | 2 # The number of statements 11 | 12 | 2 # First statement 13 | # The first domain 14 | 3 5 # 3 lines and 5 columns 15 | # i m n 1 16 | 1 1 0 0 -1 # i >= 1 17 | 1 -1 0 1 0 # i <= n 18 | 1 -1 2 0 0 # i <= 2*m 19 | # The second domain 20 | 3 5 # 3 lines and 5 columns 21 | # i m n 1 22 | 1 1 0 0 -1 # i >= 1 23 | 1 -1 0 1 0 # i <= n 24 | 1 1 -1 0 0 # i >= m 25 | 0 0 0 26 | 27 | 1 # Second statement 28 | 2 5 # 4 lines and 6 columns 29 | # i m n 1 30 | 1 1 0 -1 -1 # i >= 1 31 | 1 -1 0 2 0 # i <= n 32 | 0 0 0 33 | 0 # CLooG will set iterators names automatically 34 | 35 | 0 36 | -------------------------------------------------------------------------------- /test/reservoir/stride2.cloog: -------------------------------------------------------------------------------- 1 | # 2 | # Stride-bug: 3 | # 4 | # for (i = 2; i <= N; i+=7) { 5 | # S(i); 6 | # 7 | # becomes: 8 | # 9 | # for (i = 5; i <= N; i+=7) { 10 | # S(i); 11 | 12 | # Language 13 | c 14 | 15 | # Context 16 | 17 | 1 3 18 | 1 0 1 19 | 0 20 | 21 | # Number of statements 22 | 1 23 | 24 | 1 25 | 26 | 4 5 27 | 0 1 -7 0 -2 # i - 7j = 2 28 | 1 1 0 0 0 # i >= 0 29 | 1 -1 0 1 0 # i <= n 30 | 1 0 0 0 1 31 | 32 | 0 0 0 33 | 0 34 | # Scattering functions 35 | 1 36 | 37 | 6 10 38 | 0 1 0 0 0 0 0 0 0 0 39 | 0 0 1 0 0 0 -1 0 0 0 40 | 0 0 0 1 0 0 0 0 0 0 41 | 0 0 0 0 1 0 0 0 0 0 42 | 0 0 0 0 0 1 0 0 0 0 43 | 1 0 0 0 0 0 0 0 0 1 44 | 45 | 0 46 | -------------------------------------------------------------------------------- /test/gesced.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters {n, m | n<=m n>=2 m>=2} 5 | 3 4 6 | # m n 1 7 | 1 1 -1 0 8 | 1 1 0 -2 9 | 1 0 1 -2 10 | 0 11 | 12 | 3 # Number of statements 13 | 14 | 1 15 | # {i | 1<=i<=n} 16 | 2 5 17 | # i m n 1 18 | 1 1 0 0 -1 19 | 1 -1 0 1 0 20 | 0 0 0 21 | 22 | 1 23 | # {i, j | 1<=i<=n 1<=j<=m} 24 | 4 6 25 | # i j m n 1 26 | 1 1 0 0 0 -1 27 | 1 -1 0 0 1 0 28 | 1 0 1 0 0 -1 29 | 1 0 -1 1 0 0 30 | 0 0 0 31 | 32 | 1 33 | # {i, j | 1<=i<=n 1<=j<=m} 34 | 4 6 35 | # i j m n 1 36 | 1 1 0 0 0 -1 37 | 1 -1 0 0 1 0 38 | 1 0 1 0 0 -1 39 | 1 0 -1 1 0 0 40 | 0 0 0 41 | 0 42 | 43 | 3 # Scattering functions 44 | # Et les instructions de chunking (prog init)... 45 | 1 6 46 | # c1 i m n 1 47 | 0 1 -1 0 0 0 48 | 49 | 1 7 50 | # c1 i j m n 1 51 | 0 1 0 -1 0 -1 0 52 | 53 | 1 7 54 | # c1 i j m n 1 55 | 0 1 0 -1 0 -2 0 56 | 0 57 | -------------------------------------------------------------------------------- /test/reservoir/loechner4.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/loechner4.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.02s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j,k,l) { hash(1); hash(i); hash(j); hash(k); hash(l); } 11 | 12 | void test(int M) 13 | { 14 | /* Scattering iterators. */ 15 | int c2, c4, c6, c8; 16 | /* Original iterators. */ 17 | int i, j, k, l; 18 | for (c2=2;c2<=2*M;c2++) { 19 | for (c4=1;c4<=M;c4++) { 20 | for (c6=1;c6<=M;c6++) { 21 | for (c8=max(1,c2-M);c8<=min(c2-1,M);c8++) { 22 | l = c2-c8 ; 23 | S1(c6,c4,c8,c2-c8) ; 24 | } 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /source/isl/backend.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /** 4 | * Allocate and initialize full state. 5 | */ 6 | CloogState *cloog_state_malloc(void) 7 | { 8 | return cloog_isl_state_malloc(NULL); 9 | } 10 | 11 | /** 12 | * Allocate and initialize full state for isl backend. 13 | */ 14 | CloogState *cloog_isl_state_malloc(struct isl_ctx *ctx) 15 | { 16 | CloogState *state; 17 | int allocated = !ctx; 18 | 19 | state = cloog_core_state_malloc(); 20 | if (!ctx) 21 | ctx = isl_ctx_alloc(); 22 | state->backend = isl_alloc_type(ctx, CloogBackend); 23 | state->backend->ctx = ctx; 24 | state->backend->ctx_allocated = allocated; 25 | return state; 26 | } 27 | 28 | /** 29 | * Free state and backend independent parts. 30 | */ 31 | void cloog_state_free(CloogState *state) 32 | { 33 | if (state->backend->ctx_allocated) 34 | isl_ctx_free(state->backend->ctx); 35 | free(state->backend); 36 | cloog_core_state_free(state); 37 | } 38 | -------------------------------------------------------------------------------- /test/gesced3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/gesced3.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i) { hash(2); hash(i); } 12 | 13 | void test(int M, int N) 14 | { 15 | /* Scattering iterators. */ 16 | int c1; 17 | /* Original iterators. */ 18 | int i; 19 | for (c1=M+1;c1<=2*M;c1++) { 20 | i = c1-M ; 21 | S1(c1-M) ; 22 | } 23 | for (c1=2*M+1;c1<=M+N;c1++) { 24 | i = c1-2*M ; 25 | S2(c1-2*M) ; 26 | i = c1-M ; 27 | S1(c1-M) ; 28 | } 29 | for (c1=M+N+1;c1<=2*M+N;c1++) { 30 | i = c1-2*M ; 31 | S2(c1-2*M) ; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/infinite.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from infinite.cloog by CLooG 0.20.0-0e868c5 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S0 { hash(0); } 17 | #define S1(i) { hash(1); hash(i); } 18 | #define S2(i,j) { hash(2); hash(i); hash(j); } 19 | 20 | void test(int M, int N) 21 | { 22 | /* Original iterators. */ 23 | int i, j; 24 | for (i=-1000+0;i<=0;i++) { 25 | S1(i); 26 | } 27 | for (i=1;i<=N;i++) { 28 | S1(i); 29 | for (j=1;j<=M;j++) { 30 | S2(i,j); 31 | } 32 | } 33 | for (i=N+1;i<=1000+N+1;i++) { 34 | S1(i); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /cmake/cloog-isl-config.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the cloog-isl library 2 | 3 | # CLOOG_ISL_FOUND - System has cloog-isl lib 4 | # CLOOG_ISL_INCLUDE_DIR - The cloog-isl include directory 5 | # CLOOG_ISL_LIBRARY - Library needed to use cloog-isl 6 | 7 | 8 | if (CLOOG_ISL_INCLUDE_DIR AND CLOOG_ISL_LIBRARY) 9 | # Already in cache, be silent 10 | set(CLOOG_ISL_FIND_QUIETLY TRUE) 11 | endif() 12 | 13 | find_path(CLOOG_ISL_INCLUDE_DIR NAMES cloog/isl/cloog.h) 14 | find_library(CLOOG_ISL_LIBRARY NAMES cloog-isl) 15 | 16 | if (CLOOG_ISL_LIBRARY AND CLOOG_ISL_INCLUDE_DIR) 17 | message(STATUS "Library cloog-isl found =) ${CLOOG_ISL_LIBRARY}") 18 | else() 19 | message(STATUS "Library cloog-isl not found =(") 20 | endif() 21 | 22 | 23 | include(FindPackageHandleStandardArgs) 24 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(CLOOG_ISL DEFAULT_MSG CLOOG_ISL_INCLUDE_DIR CLOOG_ISL_LIBRARY) 25 | 26 | mark_as_advanced(CLOOG_ISL_INCLUDE_DIR CLOOG_ISL_LIBRARY) 27 | -------------------------------------------------------------------------------- /test/darte.cloog: -------------------------------------------------------------------------------- 1 | # language: C 2 | c 3 | 4 | # parameters n m 5 | 1 3 6 | # n 1 7 | 1 0 0 8 | 1 9 | n 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # S1 {i, j, k | 1<=i<=n; 1<=j<=n, 1<=k<=n} 15 | 6 6 16 | # i j k n 1 17 | 1 1 0 0 0 -1 18 | 1 -1 0 0 1 0 19 | 1 0 1 0 0 -1 20 | 1 0 -1 0 1 0 21 | 1 0 0 1 0 -1 22 | 1 0 0 -1 1 0 23 | 0 0 0 24 | 25 | 1 26 | # S2 {i, j, k | 1<=i<=n; 1<=j<=n, 1<=k<=n} 27 | 6 6 28 | # i j k n 1 29 | 1 1 0 0 0 -1 30 | 1 -1 0 0 1 0 31 | 1 0 1 0 0 -1 32 | 1 0 -1 0 1 0 33 | 1 0 0 1 0 -1 34 | 1 0 0 -1 1 0 35 | 0 0 0 36 | 0 37 | 38 | 2 39 | # Scattering functions 40 | 3 9 41 | # c1 c2 c3 i j k n 1 42 | 0 1 0 0 -1 1 0 0 0 43 | 0 0 1 0 -1 -1 0 0 0 44 | 0 0 0 1 -1 -1 -2 0 0 45 | 46 | 3 9 47 | # c1 c2 c3 i j k n 1 48 | 0 1 0 0 -1 1 0 0 -1 49 | 0 0 1 0 -1 -1 0 0 -2 50 | 0 0 0 1 0 0 -1 0 0 51 | 1 52 | t1 t2 t3 53 | -------------------------------------------------------------------------------- /test/lub.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/lub.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j,k) { hash(2); hash(i); hash(j); hash(k); } 12 | #define S3(i,j,k) { hash(3); hash(i); hash(j); hash(k); } 13 | #define S4(i,j) { hash(4); hash(i); hash(j); } 14 | 15 | void test(int M) 16 | { 17 | /* Original iterators. */ 18 | int i, j, k; 19 | for (i=1;i<=M-1;i++) { 20 | for (j=i+1;j<=M;j++) { 21 | S1(i,j) ; 22 | for (k=i+1;k<=M;k++) { 23 | S2(i,j,k) ; 24 | S3(i,j,k) ; 25 | } 26 | S4(i,j) ; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/openscop/matmult.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from matmult.scop by CLooG 0.20.0-bb9d408 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #ifdef TIME 11 | #define IF_TIME(foo) foo; 12 | #else 13 | #define IF_TIME(foo) 14 | #endif 15 | 16 | #define S1(i,j) { hash(1); hash(i); hash(j); } 17 | #define S2(i,j,k) { hash(2); hash(i); hash(j); hash(k); } 18 | 19 | void test(int N) 20 | { 21 | /* Scattering iterators. */ 22 | int c2, c4, c6; 23 | /* Original iterators. */ 24 | int i, j, k; 25 | for (c2=0;c2<=N-1;c2++) { 26 | for (c4=0;c4<=N-1;c4++) { 27 | S1(c2,c4); 28 | for (c6=0;c6<=N-1;c6++) { 29 | S2(c2,c4,c6); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/4-param.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/4-param.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i) { hash(2); hash(i); } 12 | 13 | void test(int m, int n, int p, int q) 14 | { 15 | /* Original iterators. */ 16 | int i; 17 | for (i=m;i<=min(min(n,p-1),q);i++) { 18 | S1(i) ; 19 | } 20 | for (i=p;i<=min(min(q,m-1),n);i++) { 21 | S2(i) ; 22 | } 23 | for (i=max(m,p);i<=min(n,q);i++) { 24 | S1(i) ; 25 | S2(i) ; 26 | } 27 | for (i=max(m,q+1);i<=n;i++) { 28 | S1(i) ; 29 | } 30 | for (i=max(p,n+1);i<=q;i++) { 31 | S2(i) ; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/ex1.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/ex1.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int n) 14 | { 15 | /* Original iterators. */ 16 | int i, j; 17 | for (i=0;i<=14;i++) { 18 | for (j=0;j<=n-15;j++) { 19 | S1(i,j) ; 20 | } 21 | } 22 | for (i=15;i<=n;i++) { 23 | for (j=0;j<=9;j++) { 24 | S1(i,j) ; 25 | } 26 | for (j=10;j<=n-15;j++) { 27 | S1(i,j) ; 28 | S2(i,j) ; 29 | } 30 | for (j=n-14;j<=n;j++) { 31 | S2(i,j) ; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/dartef.cloog: -------------------------------------------------------------------------------- 1 | # language: FORTRAN 2 | f 3 | 4 | # parameters n m 5 | 1 3 6 | # n 1 7 | 1 0 0 8 | 1 9 | n 10 | 11 | 2 # Number of statements 12 | 13 | 1 14 | # S1 {i, j, k | 1<=i<=n; 1<=j<=n, 1<=k<=n} 15 | 6 6 16 | # i j k n 1 17 | 1 1 0 0 0 -1 18 | 1 -1 0 0 1 0 19 | 1 0 1 0 0 -1 20 | 1 0 -1 0 1 0 21 | 1 0 0 1 0 -1 22 | 1 0 0 -1 1 0 23 | 0 0 0 24 | 25 | 1 26 | # S2 {i, j, k | 1<=i<=n; 1<=j<=n, 1<=k<=n} 27 | 6 6 28 | # i j k n 1 29 | 1 1 0 0 0 -1 30 | 1 -1 0 0 1 0 31 | 1 0 1 0 0 -1 32 | 1 0 -1 0 1 0 33 | 1 0 0 1 0 -1 34 | 1 0 0 -1 1 0 35 | 0 0 0 36 | 0 37 | 38 | 2 39 | # Scattering functions 40 | 3 9 41 | # c1 c2 c3 i j k n 1 42 | 0 1 0 0 -1 1 0 0 0 43 | 0 0 1 0 -1 -1 0 0 0 44 | 0 0 0 1 -1 -1 -2 0 0 45 | 46 | 3 9 47 | # c1 c2 c3 i j k n 1 48 | 0 1 0 0 -1 1 0 0 -1 49 | 0 0 1 0 -1 -1 0 0 -2 50 | 0 0 0 1 0 0 -1 0 0 51 | 1 52 | t1 t2 t3 53 | -------------------------------------------------------------------------------- /test/emploi.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/emploi.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i) { hash(1); hash(i); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | 13 | void test(int m, int n) 14 | { 15 | /* Original iterators. */ 16 | int i, j; 17 | if (m >= 1) { 18 | for (i=1;i<=n;i++) { 19 | if (i >= m) { 20 | S1(i) ; 21 | } 22 | if (i <= min(2*m,m-1)) { 23 | S1(i) ; 24 | } 25 | for (j=1;j<=m;j++) { 26 | S2(i,j) ; 27 | } 28 | } 29 | } 30 | if (m <= 0) { 31 | for (i=1;i<=n;i++) { 32 | S1(i) ; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test/reservoir/pingali3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./reservoir/pingali3.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.02s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j,k) { hash(2); hash(i); hash(j); hash(k); } 12 | 13 | void test(int M) 14 | { 15 | /* Scattering iterators. */ 16 | int c2, c4, c6; 17 | /* Original iterators. */ 18 | int i, j, k; 19 | for (c2=1;c2<=M;c2++) { 20 | for (c4=1;c4<=M;c4++) { 21 | S1(c2,c4) ; 22 | } 23 | } 24 | for (c2=1;c2<=M;c2++) { 25 | for (c4=1;c4<=M;c4++) { 26 | for (c6=1;c6<=M;c6++) { 27 | S2(c2,c4,c6) ; 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/forwardsub-2-1-2-3.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/forwardsub-2-1-2-3.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.01s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j,k) { hash(1); hash(i); hash(j); hash(k); } 11 | #define S2(i,j,k) { hash(2); hash(i); hash(j); hash(k); } 12 | #define S3(i,j) { hash(3); hash(i); hash(j); } 13 | #define S4(i,j) { hash(4); hash(i); hash(j); } 14 | 15 | void test(int M) 16 | { 17 | /* Original iterators. */ 18 | int i, j, k; 19 | S3(1,0) ; 20 | for (k=2;k<=M;k++) { 21 | S1(1,1,k) ; 22 | } 23 | for (i=2;i<=M-1;i++) { 24 | S4(i,0) ; 25 | for (k=i+1;k<=M;k++) { 26 | S2(i,1,k) ; 27 | } 28 | } 29 | S4(M,0) ; 30 | } 31 | -------------------------------------------------------------------------------- /test/non_optimal/youcef.good.c: -------------------------------------------------------------------------------- 1 | /* Generated from ../../../git/cloog/test/./non_optimal/youcef.cloog by CLooG 0.14.0-72-gefe2fc2 gmp bits in 0.00s. */ 2 | extern void hash(int); 3 | 4 | /* Useful macros. */ 5 | #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d)) 6 | #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d)) 7 | #define max(x,y) ((x) > (y) ? (x) : (y)) 8 | #define min(x,y) ((x) < (y) ? (x) : (y)) 9 | 10 | #define S1(i,j) { hash(1); hash(i); hash(j); } 11 | #define S2(i,j) { hash(2); hash(i); hash(j); } 12 | #define S3(i,j) { hash(3); hash(i); hash(j); } 13 | 14 | void test() 15 | { 16 | /* Original iterators. */ 17 | int i, j; 18 | for (i=0;i<=3;i++) { 19 | S1(i,i) ; 20 | S2(i,i) ; 21 | for (j=i+1;j<=4;j++) { 22 | S2(i,j) ; 23 | } 24 | S2(i,5) ; 25 | S3(i,5) ; 26 | } 27 | S1(4,4) ; 28 | S2(4,4) ; 29 | S2(4,5) ; 30 | S3(4,5) ; 31 | S1(5,5) ; 32 | S2(5,5) ; 33 | S3(5,5) ; 34 | } 35 | --------------------------------------------------------------------------------