Skip to content
Extraits de code Groupes Projets
Valider 27dea056 rédigé par Nicolas MARIE's avatar Nicolas MARIE
Parcourir les fichiers

apply style and reformat headers

parent 8899eb89
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -3,15 +3,14 @@ ...@@ -3,15 +3,14 @@
// declare opt_pass // declare opt_pass
#include <tree-pass.h> #include <tree-pass.h>
/* Enum to represent the collective operations */ /* Enum to represent the collective operations */
#define DEFMPICOLLECTIVES(CODE, NAME) CODE,
enum mpi_collective_code enum mpi_collective_code
{ {
#define DEFMPICOLLECTIVES( CODE, NAME ) CODE,
#include "mpi_collectives.def" #include "mpi_collectives.def"
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
#undef DEFMPICOLLECTIVES
}; };
#undef DEFMPICOLLECTIVES
/* Name of each MPI collective operations */ /* Name of each MPI collective operations */
#define DEFMPICOLLECTIVES(CODE, NAME) NAME, #define DEFMPICOLLECTIVES(CODE, NAME) NAME,
...@@ -21,7 +20,6 @@ const char *const mpi_collective_name[] = ...@@ -21,7 +20,6 @@ const char *const mpi_collective_name[] =
}; };
#undef DEFMPICOLLECTIVES #undef DEFMPICOLLECTIVES
class pass_mpi_collective : public opt_pass class pass_mpi_collective : public opt_pass
{ {
......
...@@ -12,8 +12,6 @@ ...@@ -12,8 +12,6 @@
// our pass // our pass
#include "pass_mpi_collective.hpp" #include "pass_mpi_collective.hpp"
// Definitions // Definitions
const pass_data my_pass_data = const pass_data my_pass_data =
{ {
...@@ -28,16 +26,13 @@ const pass_data my_pass_data = ...@@ -28,16 +26,13 @@ const pass_data my_pass_data =
0, /* todo_flags_finish */ 0, /* todo_flags_finish */
}; };
// Class functions // Class functions
pass_mpi_collective::pass_mpi_collective(gcc::context *ctxt) pass_mpi_collective::pass_mpi_collective(gcc::context *ctxt)
: opt_pass(my_pass_data, ctxt) {} : opt_pass(my_pass_data, ctxt) {}
pass_mpi_collective *pass_mpi_collective::clone() pass_mpi_collective *pass_mpi_collective::clone()
{return new pass_mpi_collective(g);} {return new pass_mpi_collective(g);}
bool pass_mpi_collective::gate(function *fun) bool pass_mpi_collective::gate(function *fun)
{ {
//printf("In gate of: %s\n", fndecl_name(fun->decl)); //printf("In gate of: %s\n", fndecl_name(fun->decl));
...@@ -46,7 +41,6 @@ bool pass_mpi_collective::gate(function *fun) ...@@ -46,7 +41,6 @@ bool pass_mpi_collective::gate(function *fun)
return true; return true;
} }
unsigned int pass_mpi_collective::execute(function *fun) unsigned int pass_mpi_collective::execute(function *fun)
{ {
printf("In execute of: %s\n", function_name(fun)); printf("In execute of: %s\n", function_name(fun));
...@@ -58,7 +52,6 @@ unsigned int pass_mpi_collective::execute(function *fun) ...@@ -58,7 +52,6 @@ unsigned int pass_mpi_collective::execute(function *fun)
return 0; return 0;
} }
void pass_mpi_collective::print_tree(function *fun) void pass_mpi_collective::print_tree(function *fun)
{ {
basic_block bb; basic_block bb;
...@@ -96,14 +89,12 @@ void pass_mpi_collective::print_tree(function *fun) ...@@ -96,14 +89,12 @@ void pass_mpi_collective::print_tree(function *fun)
bool pass_mpi_collective::is_func(gimple *stmt) bool pass_mpi_collective::is_func(gimple *stmt)
{return is_gimple_call(stmt);} {return is_gimple_call(stmt);}
bool pass_mpi_collective::__is_mpi_func(gimple *stmt) bool pass_mpi_collective::__is_mpi_func(gimple *stmt)
{return strncmp(fndecl_name(gimple_call_fndecl(stmt)), "MPI_", 4) == 0;} {return strncmp(fndecl_name(gimple_call_fndecl(stmt)), "MPI_", 4) == 0;}
bool pass_mpi_collective::is_mpi_func(gimple *stmt) bool pass_mpi_collective::is_mpi_func(gimple *stmt)
{return is_func(stmt) && __is_mpi_func(stmt);} {return is_func(stmt) && __is_mpi_func(stmt);}
mpi_collective_code pass_mpi_collective::__is_mpi_collec(gimple *stmt) mpi_collective_code pass_mpi_collective::__is_mpi_collec(gimple *stmt)
{ {
size_t i; size_t i;
...@@ -128,7 +119,6 @@ mpi_collective_code pass_mpi_collective::is_mpi_collec(gimple *stmt) ...@@ -128,7 +119,6 @@ mpi_collective_code pass_mpi_collective::is_mpi_collec(gimple *stmt)
return __is_mpi_collec(stmt); return __is_mpi_collec(stmt);
} }
// TODO tag blocks and set bb->data // TODO tag blocks and set bb->data
//void pass_mpi_collective::tag_blocks(){ //void pass_mpi_collective::tag_blocks(){
...@@ -160,8 +150,6 @@ void pass_mpi_collective::split_blocks(function *fun) ...@@ -160,8 +150,6 @@ void pass_mpi_collective::split_blocks(function *fun)
} }
} }
/* Build a filename (as a string) based on function name */ /* Build a filename (as a string) based on function name */
char *pass_mpi_collective::cfgviz_generate_filename(function *fun, char *pass_mpi_collective::cfgviz_generate_filename(function *fun,
const char *suffix) const char *suffix)
...@@ -235,6 +223,3 @@ void pass_mpi_collective::cfgviz_dump(function *fun, ...@@ -235,6 +223,3 @@ void pass_mpi_collective::cfgviz_dump(function *fun,
fclose(out); fclose(out);
free(target_filename); free(target_filename);
} }
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
// our pass // our pass
#include "pass_mpi_collective.hpp" #include "pass_mpi_collective.hpp"
/* Global variable required for plugin to execute */ /* Global variable required for plugin to execute */
int plugin_is_GPL_compatible; int plugin_is_GPL_compatible;
...@@ -35,8 +34,6 @@ plugin_init(struct plugin_name_args *plugin_info, ...@@ -35,8 +34,6 @@ plugin_init(struct plugin_name_args *plugin_info,
printf("\thelp = %s\n", plugin_info->help); printf("\thelp = %s\n", plugin_info->help);
printf("\n\n"); printf("\n\n");
pass_mpi_collective p(g); pass_mpi_collective p(g);
struct register_pass_info pass_info; struct register_pass_info pass_info;
...@@ -53,4 +50,3 @@ plugin_init(struct plugin_name_args *plugin_info, ...@@ -53,4 +50,3 @@ plugin_init(struct plugin_name_args *plugin_info,
return 0; return 0;
} }
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter