implement ir_graph_pass_set_parallel()
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 30 Dec 2009 00:46:29 +0000 (00:46 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Wed, 30 Dec 2009 00:46:29 +0000 (00:46 +0000)
[r26866]

include/libfirm/irpass.h
ir/ir/irpass.c
ir/opt/convopt.c

index 5a63793..b1e3e0d 100644 (file)
@@ -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.
index 130c57c..b96a94c 100644 (file)
@@ -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.
index 2325115..653ef1d 100644 (file)
@@ -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;
 }