From a7c6b3122cc7be047df0ceab4fe29b22fc88dff9 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 30 Dec 2009 00:46:29 +0000 Subject: [PATCH] implement ir_graph_pass_set_parallel() [r26866] --- include/libfirm/irpass.h | 10 ++++++++++ ir/ir/irpass.c | 4 ++++ ir/opt/convopt.c | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/libfirm/irpass.h b/include/libfirm/irpass.h index 5a63793d7..b1e3e0d05 100644 --- a/include/libfirm/irpass.h +++ b/include/libfirm/irpass.h @@ -168,6 +168,16 @@ ir_graph_pass_t *def_graph_pass_constructor( ir_graph_pass_t *memory, const char *name, int (*function)(ir_graph *irg, void *context)); +/** + * Set the run_parallel property of a graph pass. + * If the flag is set to non-zero, the pass can be executed + * parallel on all graphs of a ir_prog. + * + * @param pass the pass + * @param flag new flag setting + */ +void ir_graph_pass_set_parallel(ir_graph_pass_t *pass, int flag); + /** * Creates an ir_prog pass for running void function(). * Uses the default verifier and dumper. diff --git a/ir/ir/irpass.c b/ir/ir/irpass.c index 130c57ca5..b96a94c16 100644 --- a/ir/ir/irpass.c +++ b/ir/ir/irpass.c @@ -410,6 +410,10 @@ ir_graph_pass_t *def_graph_pass_constructor( return pass; } /* def_graph_pass_constructor */ +/* set the run parallel property */ +void ir_graph_pass_set_parallel(ir_graph_pass_t *pass, int flag) { + pass->run_parallel = flag != 0; +} /* ir_graph_pass_set_parallel */ /** * Wrapper for running void function(void) as an ir_prog pass. diff --git a/ir/opt/convopt.c b/ir/opt/convopt.c index 2325115c7..653ef1d40 100644 --- a/ir/opt/convopt.c +++ b/ir/opt/convopt.c @@ -302,8 +302,8 @@ ir_graph_pass_t *conv_opt_pass(const char *name) { ir_graph_pass_t *path = def_graph_pass_ret(name ? name : "conv_opt", conv_opt); - // safe to run parallel on all irgs - path->run_parallel = 1; + /* safe to run parallel on all irgs */ + ir_graph_pass_set_parallel(path, 1); return path; } -- 2.20.1