Commit 10205d4a authored by Michael Beck's avatar Michael Beck
Browse files

- add pass for optimize_graph_df()

[r26348]
parent 818856f8
......@@ -56,6 +56,17 @@ void local_optimize_graph(ir_graph *irg);
*/
int optimize_graph_df(ir_graph *irg);
/**
* Creates an ir_graph pass for optimize_graph_df().
*
* @param name the name of this pass or NULL
* @param verify should this pass be verified?
* @param dump should this pass result be dumped?
*
* @return the newly created ir_graph pass
*/
ir_graph_pass_t *optimize_graph_df_pass(const char *name, int verify, int dump);
/** Performs dead node elimination by copying the ir graph to a new obstack.
*
* The major intention of this pass is to free memory occupied by
......
......@@ -39,6 +39,7 @@
#include "adt/pdeq.h"
#include "irpass_t.h"
#include "irflag_t.h"
#include "iredges_t.h"
#include "irtools.h"
......@@ -220,3 +221,27 @@ int optimize_graph_df(ir_graph *irg) {
current_ir_graph = rem;
return changed;
}
/**
* Wrapper for running optimize_graph_df() as an ir_graph pass.
*/
static int pass_wrapper(ir_graph *irg, void *context) {
(void)context;
return optimize_graph_df(irg);
} /* pass_wrapper */
/* Creates an ir_graph pass for optimize_graph_df. */
ir_graph_pass_t *optimize_graph_df_pass(const char *name, int verify, int dump) {
struct ir_graph_pass_t *pass = XMALLOCZ(ir_graph_pass_t);
pass->kind = k_ir_prog_pass;
pass->run_on_irg = pass_wrapper;
pass->context = pass;
pass->name = name ? name : "optimize_graph_df";
pass->verify = verify != 0;
pass->dump = dump != 0;
INIT_LIST_HEAD(&pass->list);
return pass;
} /* combo_pass */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment