From 16fdd0b79c4f84ed092b54d5c4661b5b19cad1d8 Mon Sep 17 00:00:00 2001 From: Cedric Bastoul Date: Thu, 2 Oct 2014 18:33:19 +0200 Subject: [PATCH] Solve minor building errors and warnings --- Makefile.am | 1 + isl | 2 +- osl | 2 +- source/program.c | 96 ++++++++++++++++++++++++------------------------ test/isl/jacobi-shared.c | 4 +- 5 files changed, 53 insertions(+), 52 deletions(-) diff --git a/Makefile.am b/Makefile.am index cc2f000..f968b2e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -46,6 +46,7 @@ if BUNDLED_OSL OSL_LA = $(top_builddir)/osl/libosl.la endif +AUTOMAKE_OPTIONS = subdir-objects SUBDIRS = $(MAYBE_ISL) $(MAYBE_OSL) . doc test DIST_SUBDIRS = $(MAYBE_ISL) $(MAYBE_OSL) . doc test diff --git a/isl b/isl index 14d7941..8241654 160000 --- a/isl +++ b/isl @@ -1 +1 @@ -Subproject commit 14d7941489582c8ace26f661f78936041641edf7 +Subproject commit 82416541bfb8fc2acb026dc6680a25dcf862aa23 diff --git a/osl b/osl index beeef6c..0faec76 160000 --- a/osl +++ b/osl @@ -1 +1 @@ -Subproject commit beeef6cf937b26befaac17179e9a35512c7c284d +Subproject commit 0faec76f293b3ec6fe498a68a5f286027b28afb9 diff --git a/source/program.c b/source/program.c index 89d6774..8333005 100644 --- a/source/program.c +++ b/source/program.c @@ -320,47 +320,6 @@ static void print_iterator_declarations(FILE *file, CloogProgram *program, } } -static int get_osl_loop_flags (osl_scop_p scop) { - int flags = 0; - osl_loop_p ll = osl_generic_lookup(scop->extension, OSL_URI_LOOP); - while (ll) { - flags |= ll->directive; - ll = ll->next; - } - - return flags; -} - -static void print_iterator_declarations_osl(FILE *file, CloogProgram *program, - CloogOptions *options) -{ - osl_coordinates_p co = NULL; - int loopflags = 0; - char* vecvar[2] = {"lbv", "ubv"}; - char* parvar[2] = {"lbp", "ubp"}; - - osl_scop_p scop = options->scop; - CloogNames *names = program->names; - - if (names->nb_scattering) { - fprintf(file, " /* Scattering iterators. */\n"); - print_declarations(file, names->nb_scattering, names->scattering); - } - - co = osl_generic_lookup(scop->extension, OSL_URI_COORDINATES); - if (co==NULL //if coordinates exist then iterators already declared in file - && names->nb_iterators) { - fprintf(file, " /* Original iterators. */\n"); - print_declarations(file, names->nb_iterators, names->iterators); - } - - loopflags = get_osl_loop_flags(scop); - if(loopflags & CLAST_PARALLEL_OMP) - print_declarations(file, 2, parvar); - if(loopflags & CLAST_PARALLEL_VEC) - print_declarations(file, 2, vecvar); -} - static void print_callable_preamble(FILE *file, CloogProgram *program, CloogOptions *options) { @@ -403,10 +362,52 @@ static void print_callable_postamble(FILE *file, CloogProgram *program) fprintf(file, "}\n"); } +#ifdef OSL_SUPPORT +static int get_osl_loop_flags (osl_scop_p scop) { + int flags = 0; + osl_loop_p ll = osl_generic_lookup(scop->extension, OSL_URI_LOOP); + while (ll) { + flags |= ll->directive; + ll = ll->next; + } + + return flags; +} + +static void print_iterator_declarations_osl(FILE *file, CloogProgram *program, + CloogOptions *options) +{ + osl_coordinates_p co = NULL; + int loopflags = 0; + char* vecvar[2] = {"lbv", "ubv"}; + char* parvar[2] = {"lbp", "ubp"}; + + osl_scop_p scop = options->scop; + CloogNames *names = program->names; + + if (names->nb_scattering) { + fprintf(file, " /* Scattering iterators. */\n"); + print_declarations(file, names->nb_scattering, names->scattering); + } + + co = osl_generic_lookup(scop->extension, OSL_URI_COORDINATES); + if (co==NULL //if coordinates exist then iterators already declared in file + && names->nb_iterators) { + fprintf(file, " /* Original iterators. */\n"); + print_declarations(file, names->nb_iterators, names->iterators); + } + + loopflags = get_osl_loop_flags(scop); + if(loopflags & CLAST_PARALLEL_OMP) + print_declarations(file, 2, parvar); + if(loopflags & CLAST_PARALLEL_VEC) + print_declarations(file, 2, vecvar); +} + /* * add tags clast loops according to information in scop's osl_loop extension */ -int annotate_loops(osl_scop_p program, struct clast_stmt *root){ +static int annotate_loops(osl_scop_p program, struct clast_stmt *root){ int j, nclastloops, nclaststmts; struct clast_for **clastloops = NULL; @@ -421,11 +422,11 @@ int annotate_loops(osl_scop_p program, struct clast_stmt *root){ while (ll) { //for each loop osl_loop_p loop = ll; + ClastFilter filter = { loop->iter, loop->stmt_ids, + loop->nb_stmts, subset}; - ClastFilter filter = {loop->iter, loop->stmt_ids, - loop->nb_stmts, subset}; clast_filter(root, filter, &clastloops, &nclastloops, - &claststmts, &nclaststmts); + &claststmts, &nclaststmts); /* There should be at least one */ if (nclastloops==0) { //FROM PLUTO @@ -458,7 +459,7 @@ int annotate_loops(osl_scop_p program, struct clast_stmt *root){ return ret; } - +#endif /** * cloog_program_osl_pprint function: @@ -484,7 +485,6 @@ int cloog_program_osl_pprint(FILE * file, CloogProgram * program, osl_coordinates_p coordinates; struct clast_stmt *root; FILE * original; - int annotate_result = 0; if (scop && !options->compilable && !options->callable) { coordinates = osl_generic_lookup(scop->extension, OSL_URI_COORDINATES); @@ -520,7 +520,7 @@ int cloog_program_osl_pprint(FILE * file, CloogProgram * program, /* Generate the clast from the pseudo-AST then pretty-print it. */ root = cloog_clast_create(program, options); - annotate_result = annotate_loops(options->scop, root); + annotate_loops(options->scop, root); print_iterator_declarations_osl(file, program, options); clast_pprint(file, root, coordinates->indent, options); cloog_clast_free(root); diff --git a/test/isl/jacobi-shared.c b/test/isl/jacobi-shared.c index 8b0cfd1..e06127e 100644 --- a/test/isl/jacobi-shared.c +++ b/test/isl/jacobi-shared.c @@ -1,9 +1,9 @@ -/* Generated from ./isl/jacobi-shared.cloog by CLooG 0.18.1-2-g43fc508 gmp bits in 0.33s. */ +/* Generated from ./isl/jacobi-shared.cloog by CLooG gmp bits in 0.31s. */ if ((h0+1)%2 == 0) { if ((16*floord(t0-1,16) >= -N+g1+t0+1) && (16*floord(g1+t0-3,16) >= -N+g1+t0+1) && (32*floord(t1-1,32) >= -N+g2+t1+1) && (32*floord(g2+t1-3,32) >= t1-32)) { for (c0=max(-16*floord(t0-1,16)+t0,-16*floord(g1+t0-3,16)+t0);c0<=min(32,N-g1-1);c0+=16) { for (c1=-32*floord(t1-1,32)+t1;c1<=min(32,N-g2-1);c1+=32) { - if ((c1 >= 1) && (c1 <= 32)) { + if (c1 >= 1) { S1((c0+g1-1),(c1+g2-1)); } } -- 2.11.4.GIT