New flag: -fgraphite-dump-cloog.
Introduce a new flag: -fgraphite-dump-cloog. If enabled, graphite dumps each SCoP into a CLooG input file for further debugging. The naming follows the naming scheme of -fgraphite-write: <basename>.<scopnumber>.cloog The file is dumped into the current working directory. 2010-09-16 Andreas Simbuerger <simbuerg@fim.uni-passau.de> * common.opt (fgraphite-dump-cloog): New flag. * doc/invoke.texi (-fgraphite-dump-cloog): Documented. * graphite-clast-to-gimple.c (init_cloog_input_file): New. (build_cloog_prog): Dump CLooG input file when flag_graphite_dump_cloog is set. * graphite-cloog-compat.h (cloog_program_dump_cloog): New. From-SVN: r164808
This commit is contained in:
parent
61c6973f4c
commit
03c830c2d9
4 changed files with 66 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
|||
2010-09-30 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
|
||||
|
||||
* graphite-clast-to-gimple.c (init_cloog_input_file): New.
|
||||
(build_cloog_prog): Dump CLooG input file when
|
||||
flag_graphite_dump_cloog is set. This is disabled on trunk.
|
||||
* graphite-cloog-compat.h (cloog_program_dump_cloog): New.
|
||||
|
||||
2010-09-30 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
* graphite-clast-to-gimple.c (graphite_verify): Remove call to
|
||||
|
|
|
@ -1,3 +1,24 @@
|
|||
2010-09-21 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
|
||||
|
||||
* common.opt (fgraphite-dump-cloog): New flag.
|
||||
* doc/invoke.texi (-fgraphite-dump-cloog): Documented.
|
||||
* graphite-clast-to-gimple.c (init_cloog_input_file): New.
|
||||
(build_cloog_prog): Dump CLooG input file when
|
||||
flag_graphite_dump_cloog is set.
|
||||
* graphite-cloog-compat.h (cloog_program_dump_cloog): New.
|
||||
|
||||
2010-09-20 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
Revert previous patch "New flag: -fgraphite-dump-cloog."
|
||||
|
||||
2010-09-20 Andreas Simbuerger <simbuerg@fim.uni-passau.de>
|
||||
|
||||
* common.opt (fgraphite-dump-cloog): New flag.
|
||||
* doc/invoke.texi (-fgraphite-dump-cloog): Documented.
|
||||
* graphite-clast-to-gimple.c (init_cloog_input_file): New.
|
||||
(build_cloog_prog): Dump CLooG input file when
|
||||
flag_graphite_dump_cloog is set.
|
||||
|
||||
2010-09-20 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
* graphite-clast-to-gimple.c (graphite_verify): Remove call to
|
||||
|
|
|
@ -1216,6 +1216,31 @@ initialize_cloog_names (scop_p scop, CloogProgram *prog)
|
|||
scattering);
|
||||
}
|
||||
|
||||
/* Initialize a CLooG input file. */
|
||||
|
||||
static FILE *
|
||||
init_cloog_input_file (int scop_number)
|
||||
{
|
||||
FILE *graphite_out_file;
|
||||
int len = strlen (dump_base_name);
|
||||
char *dumpname = XNEWVEC (char, len + 25);
|
||||
char *s_scop_number = XNEWVEC (char, 15);
|
||||
|
||||
memcpy (dumpname, dump_base_name, len + 1);
|
||||
strip_off_ending (dumpname, len);
|
||||
sprintf (s_scop_number, ".%d", scop_number);
|
||||
strcat (dumpname, s_scop_number);
|
||||
strcat (dumpname, ".cloog");
|
||||
graphite_out_file = fopen (dumpname, "w+b");
|
||||
|
||||
if (graphite_out_file == 0)
|
||||
fatal_error ("can%'t open %s for writing: %m", dumpname);
|
||||
|
||||
free (dumpname);
|
||||
|
||||
return graphite_out_file;
|
||||
}
|
||||
|
||||
/* Build cloog program for SCoP. */
|
||||
|
||||
static void
|
||||
|
@ -1306,6 +1331,17 @@ build_cloog_prog (scop_p scop, CloogProgram *prog,
|
|||
/* Extract scalar dimensions to simplify the code generation problem. */
|
||||
cloog_program_extract_scalars (prog, scattering, options);
|
||||
|
||||
/* Dump a .cloog input file, if requested. This feature is only
|
||||
enabled in the Graphite branch. */
|
||||
if (0)
|
||||
{
|
||||
static size_t file_scop_number = 0;
|
||||
FILE *cloog_file = init_cloog_input_file (file_scop_number);
|
||||
|
||||
cloog_program_dump_cloog (cloog_file, prog, scattering);
|
||||
++file_scop_number;
|
||||
}
|
||||
|
||||
/* Apply scattering. */
|
||||
cloog_program_scatter (prog, scattering, options);
|
||||
free_scattering (scattering);
|
||||
|
|
|
@ -72,6 +72,8 @@ typedef const char *clast_name_p;
|
|||
#define cloog_scattering cloog_domain
|
||||
#define cloog_next_scattering cloog_next_domain
|
||||
#define cloog_scattering_free cloog_domain_free
|
||||
#define cloog_program_dump_cloog(DUMPFILE, PROGRAM, SCATTERINGLIST)\
|
||||
cloog_program_dump_cloog (DUMPFILE, PROGRAM)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue