Commit 7a483ab9 authored by Matthias Braun's avatar Matthias Braun
Browse files

remove opt_manage, provide assure_irg_properties

The opt_manage framework didn't really do much except assuring that some
analysis info is computed before a pass starts. We can achieve this
simpler by providing an assure_irg_properties function.
This commit also fixes some places where analysis info was potentially
not invalidated before.
parent 18329a03
......@@ -464,31 +464,58 @@ typedef enum ir_graph_properties_t {
IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES = 1U << 0,
/** graph contains no Bad nodes */
IR_GRAPH_PROPERTY_NO_BADS = 1U << 1,
/** No tuple nodes exist in the graph */
IR_GRAPH_PROPERTY_NO_TUPLES = 1U << 2,
/**
* there exists no (obviously) unreachable code in the graph.
* Unreachable in this context is code that you can't reach by following
* execution flow from the start block.
*/
IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE = 1U << 2,
IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE = 1U << 3,
/** graph contains at most one return */
IR_GRAPH_PROPERTY_ONE_RETURN = 1U << 3,
IR_GRAPH_PROPERTY_ONE_RETURN = 1U << 4,
/** dominance information about the graph is valid */
IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE = 1U << 4,
IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE = 1U << 5,
/** postdominance information about the graph is valid */
IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE = 1U << 5,
IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE = 1U << 6,
/**
* out edges (=iredges) are enable and there is no dead code that can be
* reached by following them
*/
IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES = 1U << 6,
IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES = 1U << 7,
/** outs (irouts) are computed and up to date */
IR_GRAPH_PROPERTY_CONSISTENT_OUTS = 1U << 7,
IR_GRAPH_PROPERTY_CONSISTENT_OUTS = 1U << 8,
/** loopinfo is computed and up to date */
IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO = 1U << 8,
IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO = 1U << 9,
/** entity usage information is computed and up to date */
IR_GRAPH_PROPERTY_CONSISTENT_ENTITY_USAGE = 1U << 9,
IR_GRAPH_PROPERTY_CONSISTENT_ENTITY_USAGE = 1U << 10,
/** graph contains as many returns as possible */
IR_GRAPH_PROPERTY_MANY_RETURNS = 1U << 10,
IR_GRAPH_PROPERTY_MANY_RETURNS = 1U << 11,
/**
* List of all graph properties that are only affected byt control flow
* changes.
*/
IR_GRAPH_PROPERTIES_CONTROL_FLOW =
IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES
| IR_GRAPH_PROPERTY_ONE_RETURN
| IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE
| IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO
| IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE
| IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE,
/**
* List of all graph properties.
*/
IR_GRAPH_PROPERTIES_ALL =
IR_GRAPH_PROPERTIES_CONTROL_FLOW
| IR_GRAPH_PROPERTY_NO_BADS
| IR_GRAPH_PROPERTY_NO_TUPLES
| IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES
| IR_GRAPH_PROPERTY_CONSISTENT_OUTS
| IR_GRAPH_PROPERTY_CONSISTENT_ENTITY_USAGE
| IR_GRAPH_PROPERTY_MANY_RETURNS,
} ir_graph_properties_t;
ENUM_BITSET(ir_graph_properties_t)
......@@ -520,6 +547,19 @@ FIRM_API unsigned get_irg_fp_model(const ir_graph *irg);
/** Sets a floating point model for this graph. */
FIRM_API void set_irg_fp_model(ir_graph *irg, unsigned model);
/**
* Ensures that a graph fulfills all properties stated in @p state.
* Performs graph transformations if necessary.
*/
FIRM_API void assure_irg_properties(ir_graph *irg, ir_graph_properties_t props);
/**
* Invalidates all graph properties/analysis data except the ones specified
* in @p props.
* This should be called after a transformation phase.
*/
FIRM_API void confirm_irg_properties(ir_graph *irg, ir_graph_properties_t props);
/**
* Accesses custom graph data.
* The data must have been registered with
......
......@@ -285,12 +285,6 @@ FIRM_API size_t get_irp_n_asms(void);
/** Returns the global asm include at position pos. */
FIRM_API ident *get_irp_asm(size_t pos);
/** Returns whether optimization dump vcg graphs */
FIRM_API int get_irp_optimization_dumps(void);
/** Enable vcg dumping of optimization */
FIRM_API void enable_irp_optimization_dumps(void);
/** @} */
#include "end.h"
......
......@@ -42,7 +42,6 @@
#include "debug.h"
#include "error.h"
#include "irflag.h"
#include "opt_manage.h"
/**
* Walker environment.
......@@ -563,14 +562,16 @@ static void insert_Confirm(ir_node *node, void *data)
}
}
/*
* Construct Confirm nodes
*/
static ir_graph_properties_t do_construct_confirms(ir_graph *irg)
void construct_confirms(ir_graph *irg)
{
env_t env;
FIRM_DBG_REGISTER(dbg, "firm.ana.confirm");
assure_irg_properties(irg,
IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES
| IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE
| IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES);
assert(get_irg_pinned(irg) == op_pin_state_pinned &&
"Nodes must be placed to insert Confirms");
......@@ -591,20 +592,8 @@ static ir_graph_properties_t do_construct_confirms(ir_graph *irg)
DB((dbg, LEVEL_1, "# Const replacements: %u\n", env.num_consts));
DB((dbg, LEVEL_1, "# node equalities : %u\n", env.num_eq));
DB((dbg, LEVEL_1, "# non-null Confirms : %u\n", env.num_non_null));
return 0;
}
static optdesc_t opt_confirms = {
"confirms",
IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES
| IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE
| IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES,
do_construct_confirms
};
void construct_confirms(ir_graph *irg)
{
perform_irg_optimization(irg, &opt_confirms);
confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_CONTROL_FLOW);
}
ir_graph_pass_t *construct_confirms_pass(const char *name)
......@@ -627,6 +616,7 @@ static void remove_confirm(ir_node *n, void *env)
void remove_confirms(ir_graph *irg)
{
irg_walk_graph(irg, NULL, remove_confirm, NULL);
confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_CONTROL_FLOW);
}
ir_graph_pass_t *remove_confirms_pass(const char *name)
......
......@@ -950,6 +950,8 @@ static void analyse_irg_entity_usage(ir_graph *irg)
size_t i, n;
int j, k, static_link_arg;
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUTS);
/* set initial state to not_taken, as this is the "smallest" state */
for (i = 0, n = get_class_n_members(ft); i < n; ++i) {
ir_entity *ent = get_class_member(ft, i);
......@@ -963,8 +965,6 @@ static void analyse_irg_entity_usage(ir_graph *irg)
}
}
assure_irg_outs(irg);
irg_frame = get_irg_frame(irg);
for (j = get_irn_n_outs(irg_frame) - 1; j >= 0; --j) {
......@@ -1021,7 +1021,6 @@ static void analyse_irg_entity_usage(ir_graph *irg)
}
}
/* now computed */
add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_ENTITY_USAGE);
}
......
......@@ -631,6 +631,7 @@ void edges_deactivate_kind(ir_graph *irg, ir_edge_kind_t kind)
ir_edgeset_destroy(&info->edges);
info->allocated = 0;
}
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES);
}
int (edges_activated_kind)(const ir_graph *irg, ir_edge_kind_t kind)
......@@ -917,6 +918,7 @@ void assure_edges(ir_graph *irg)
{
assure_edges_kind(irg, EDGE_KIND_BLOCK);
assure_edges_kind(irg, EDGE_KIND_NORMAL);
add_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES);
}
void assure_edges_kind(ir_graph *irg, ir_edge_kind_t kind)
......
......@@ -46,6 +46,8 @@
#include "iredges_t.h"
#include "type_t.h"
#include "irmemory.h"
#include "iroptimize.h"
#include "irgopt.h"
#define INITIAL_IDX_IRN_MAP_SIZE 1024
......@@ -797,3 +799,43 @@ int (irg_has_properties)(const ir_graph *irg, ir_graph_properties_t props)
{
return irg_has_properties_(irg, props);
}
typedef void (*assure_property_func)(ir_graph *irg);
void assure_irg_properties(ir_graph *irg, ir_graph_properties_t props)
{
static struct {
ir_graph_properties_t property;
assure_property_func func;
} property_functions[] = {
{ IR_GRAPH_PROPERTY_ONE_RETURN, normalize_one_return },
{ IR_GRAPH_PROPERTY_MANY_RETURNS, normalize_n_returns },
{ IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES, remove_critical_cf_edges },
{ IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE, remove_unreachable_code },
{ IR_GRAPH_PROPERTY_NO_BADS, remove_bads },
{ IR_GRAPH_PROPERTY_NO_TUPLES, remove_tuples },
{ IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE, assure_doms },
{ IR_GRAPH_PROPERTY_CONSISTENT_POSTDOMINANCE, assure_postdoms },
{ IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES, assure_edges },
{ IR_GRAPH_PROPERTY_CONSISTENT_OUTS, assure_irg_outs },
{ IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO, assure_loopinfo },
{ IR_GRAPH_PROPERTY_CONSISTENT_ENTITY_USAGE, assure_irg_entity_usage_computed },
};
size_t i;
for (i = 0; i < ARRAY_SIZE(property_functions); ++i) {
ir_graph_properties_t missing = props & ~irg->properties;
if (missing & property_functions[i].property)
property_functions[i].func(irg);
}
assert((props & ~irg->properties) == IR_GRAPH_PROPERTIES_NONE);
}
void confirm_irg_properties(ir_graph *irg, ir_graph_properties_t props)
{
clear_irg_properties(irg, ~props);
if (! (props & IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES))
edges_deactivate(irg);
if (! (props & IR_GRAPH_PROPERTY_CONSISTENT_OUTS)
&& (irg->properties & IR_GRAPH_PROPERTY_CONSISTENT_OUTS))
free_irg_outs(irg);
}
......@@ -398,16 +398,6 @@ ident *get_irp_asm(size_t pos)
return irp->global_asms[pos];
}
int (get_irp_optimization_dumps)(void)
{
return get_irp_optimization_dumps_();
}
void (enable_irp_optimization_dumps)(void)
{
enable_irp_optimization_dumps_();
}
#ifndef NDEBUG
void irp_reserve_resources(ir_prog *irp, irp_resources_t resources)
{
......
......@@ -103,20 +103,6 @@ static inline ir_label_t get_irp_next_label_nr_(void)
return ++irp->last_label_nr;
}
/** Whether optimizations should dump irgs */
static inline int get_irp_optimization_dumps_(void)
{
assert(irp);
return irp->optimization_dumps;
}
/** Set optimizations to dump irgs */
static inline void enable_irp_optimization_dumps_(void)
{
assert(irp);
irp->optimization_dumps = 1;
}
void set_irp_ip_outedges(ir_node ** ip_outedges);
ir_node** get_irp_ip_outedges(void);
......@@ -143,7 +129,5 @@ void remove_irp_type(ir_type *typ);
#define get_glob_type() get_glob_type_()
#define get_tls_type() get_tls_type_()
#define get_irp_next_label_nr() get_irp_next_label_nr_()
#define get_irp_optimization_dumps() get_irp_optimization_dumps_()
#define enable_irp_optimization_dumps() enable_irp_optimization_dumps_()
#endif
......@@ -652,7 +652,6 @@ struct ir_prog {
size_t max_irg_idx; /**< highest unused irg index */
long max_node_nr; /**< to generate unique numbers for nodes. */
unsigned dump_nr; /**< number of program info dumps */
unsigned optimization_dumps :1; /**< dump irg on each optimization */
#ifndef NDEBUG
irp_resources_t reserved_resources; /**< Bitset for tracking used global resources. */
#endif
......
......@@ -146,4 +146,5 @@ void remove_bads(ir_graph *irg)
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUTS);
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
}
add_irg_properties(irg, IR_GRAPH_PROPERTY_NO_BADS);
}
......@@ -57,4 +57,5 @@ static void exchange_tuple_projs(ir_node *node, void *env)
void remove_tuples(ir_graph *irg)
{
irg_walk_graph(irg, exchange_tuple_projs, NULL, NULL);
add_irg_properties(irg, IR_GRAPH_PROPERTY_NO_TUPLES);
}
......@@ -117,17 +117,16 @@ void remove_unreachable_code(ir_graph *irg)
{
bool changed = false;
assure_doms(irg);
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
irg_walk_graph(irg, unreachable_to_bad, NULL, &changed);
remove_unreachable_keeps(irg);
if (changed) {
edges_deactivate(irg);
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUTS
| IR_GRAPH_PROPERTY_NO_BADS
| IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES
| IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
}
confirm_irg_properties(irg, changed
? IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES
| IR_GRAPH_PROPERTY_NO_TUPLES
| IR_GRAPH_PROPERTY_ONE_RETURN
| IR_GRAPH_PROPERTY_MANY_RETURNS
: IR_GRAPH_PROPERTIES_ALL);
add_irg_properties(irg, IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE);
}
......@@ -38,7 +38,6 @@
#include "tv.h"
#include "irpass.h"
#include "debug.h"
#include "opt_manage.h"
/** Describes a pair of relative conditions lo < hi, lo rel_lo x, hi rel_hi x */
typedef struct cond_pair {
......@@ -716,10 +715,9 @@ restart:
}
}
static ir_graph_properties_t do_simplify_bool(ir_graph *const irg)
void opt_bool(ir_graph *const irg)
{
bool_opt_env_t env;
ir_graph_properties_t res = 0;
/* register a debug mask */
FIRM_DBG_REGISTER(dbg, "firm.opt.bool");
......@@ -729,30 +727,14 @@ static ir_graph_properties_t do_simplify_bool(ir_graph *const irg)
/* optimize simple Andb and Orb cases */
irg_walk_graph(irg, NULL, bool_walk, &env);
ir_reserve_resources(irg, IR_RESOURCE_BLOCK_MARK | IR_RESOURCE_PHI_LIST);
/* now more complicated cases: find control flow And/Or and optimize. */
ir_reserve_resources(irg, IR_RESOURCE_BLOCK_MARK | IR_RESOURCE_PHI_LIST);
irg_walk_graph(irg, clear_block_infos, collect_phis, NULL);
irg_block_walk_graph(irg, NULL, find_cf_and_or_walker, &env);
if (! env.changed) {
res |= IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE;
}
ir_free_resources(irg, IR_RESOURCE_BLOCK_MARK | IR_RESOURCE_PHI_LIST);
return res;
}
static optdesc_t opt_simplify_bool = {
"bool-simplification",
IR_GRAPH_PROPERTY_ONE_RETURN, /* works better with one return block only */
do_simplify_bool,
};
void opt_bool(ir_graph *irg)
{
perform_irg_optimization(irg, &opt_simplify_bool);
confirm_irg_properties(irg,
env.changed ? IR_GRAPH_PROPERTIES_NONE : IR_GRAPH_PROPERTIES_ALL);
}
/* Creates an ir_graph pass for opt_bool. */
......
......@@ -46,7 +46,6 @@
#include "irdump.h"
#include "irverify.h"
#include "iredges.h"
#include "opt_manage.h"
#include "array_t.h"
......@@ -809,12 +808,13 @@ static void cfgopt_ignoring_phis(ir_graph *irg)
irg_block_walk_graph(irg, NULL, optimize_ifs, &env);
if (env.changed) {
clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_NONE);
/* clear block info, because it must be recomputed */
irg_block_walk_graph(irg, clear_block_info, NULL, &env.block_infos);
/* Removing blocks and Conds might enable more optimizations */
continue;
} else {
confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_ALL);
break;
}
}
......@@ -823,7 +823,7 @@ static void cfgopt_ignoring_phis(ir_graph *irg)
}
/* Optimizations of the control flow that also require changes of Phi nodes. */
static ir_graph_properties_t do_cfopt(ir_graph *irg)
void optimize_cf(ir_graph *irg)
{
int i, j, n;
ir_node **in = NULL;
......@@ -840,7 +840,7 @@ static ir_graph_properties_t do_cfopt(ir_graph *irg)
assert(get_irg_pinned(irg) != op_pin_state_floats &&
"Control flow optimization need a pinned graph");
edges_deactivate(irg);
assure_irg_properties(irg, IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE);
/* First the "simple" optimizations, which do not touch Phis */
cfgopt_ignoring_phis(irg);
......@@ -866,7 +866,7 @@ static ir_graph_properties_t do_cfopt(ir_graph *irg)
* It walks only over block nodes and adapts these and the Phi nodes in
* these blocks, which it finds in a linked list computed before.
*/
assure_doms(irg);
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
irg_block_walk_graph(irg, optimize_blocks, merge_blocks, &env);
new_end = optimize_in_place(end);
......@@ -915,18 +915,8 @@ static ir_graph_properties_t do_cfopt(ir_graph *irg)
}
}
return 0;
}
static optdesc_t opt_cf = {
"control-flow",
IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE,
do_cfopt,
};
void optimize_cf(ir_graph *irg)
{
perform_irg_optimization(irg, &opt_cf);
confirm_irg_properties(irg,
env.changed ? IR_GRAPH_PROPERTIES_NONE : IR_GRAPH_PROPERTIES_ALL);
}
/* Creates an ir_graph pass for optimize_cf. */
......
......@@ -38,7 +38,6 @@
#include "irouts.h"
#include "irgopt.h"
#include "irpass.h"
#include "opt_manage.h"
static bool is_block_reachable(ir_node *block)
{
......@@ -396,12 +395,18 @@ static void place_late(ir_graph *irg, waitq *worklist)
}
/* Code Placement. */
static ir_graph_properties_t do_codeplacement(ir_graph *irg)
void place_code(ir_graph *irg)
{
waitq *worklist;
/* Handle graph state */
assert(get_irg_phase_state(irg) != phase_building);
assure_irg_properties(irg,
IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES |
IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE |
IR_GRAPH_PROPERTY_CONSISTENT_OUTS |
IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE |
IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
/* Place all floating nodes as early as possible. This guarantees
a legal code placement. */
......@@ -419,22 +424,7 @@ static ir_graph_properties_t do_codeplacement(ir_graph *irg)
place_late(irg, worklist);
del_waitq(worklist);
return 0;
}
static optdesc_t opt_codeplacement = {
"code-placement",
IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES |
IR_GRAPH_PROPERTY_NO_UNREACHABLE_CODE |
IR_GRAPH_PROPERTY_CONSISTENT_OUTS |
IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE |
IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO,
do_codeplacement,
};
void place_code(ir_graph *irg)
{
perform_irg_optimization(irg, &opt_codeplacement);
confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_NONE);
}
/**
......@@ -448,26 +438,6 @@ static void place_code_wrapper(ir_graph *irg)
set_opt_global_cse(0);
}
#if 0
static ir_graph_properties_t do_gcse(ir_graph *irg)
{
set_opt_global_cse(1);
optimize_graph_df(irg);
do_codeplacement(irg);
set_opt_global_cse(0);
return 0;
}
static optdesc_t opt_gcse = {
"gcse",
IR_GRAPH_PROPERTY_NO_CRITICAL_EDGES |
IR_GRAPH_PROPERTY_CONSISTENT_OUTS |
IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE |
IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO,
do_gcse,
};
#endif
ir_graph_pass_t *place_code_pass(const char *name)
{
return def_graph_pass(name ? name : "place", place_code_wrapper);
......
......@@ -83,7 +83,6 @@
#include "irpass.h"
#include "tv_t.h"
#include "irtools.h"
#include "opt_manage.h"
#include "irprintf.h"
#include "irdump.h"
......@@ -3512,7 +3511,7 @@ static void add_memory_keeps(ir_node **kept_memory, size_t len)
ir_nodeset_destroy(&set);
} /* add_memory_keeps */
static ir_graph_properties_t do_combo(ir_graph *irg)
void combo(ir_graph *irg)
{
environment_t env;
ir_node *initial_bl;
......@@ -3520,6 +3519,11 @@ static ir_graph_properties_t do_combo(ir_graph *irg)
ir_graph *rem = current_ir_graph;
size_t len;
assure_irg_properties(irg,
IR_GRAPH_PROPERTY_NO_BADS
| IR_GRAPH_PROPERTY_CONSISTENT_OUTS
| IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO);
current_ir_graph = irg;
/* register a debug mask */
......@@ -3622,20 +3626,9 @@ static ir_graph_properties_t do_combo(ir_graph *irg)
set_value_of_func(NULL);
current_ir_graph = rem;
return 0; // cannot guarantee anything
confirm_irg_properties(irg, IR_GRAPH_PROPERTIES_NONE);
} /* combo */
static optdesc_t opt_combo = {
"combo",
IR_GRAPH_PROPERTY_NO_BADS | IR_GRAPH_PROPERTY_CONSISTENT_OUTS | IR_GRAPH_PROPERTY_CONSISTENT_LOOPINFO,
do_combo,
};
void combo(ir_graph *irg)
{
perform_irg_optimization(irg, &opt_combo);
}
/* Creates an ir_graph pass for combo. */
ir_graph_pass_t *combo_pass(const char *name)
{
......
......@@ -53,7 +53,6 @@
#include "irpass_t.h"
#include "tv.h"
#include "vrp.h"
#include "opt_manage.h"
DEBUG_ONLY(static firm_dbg_module_t *dbg;)
......@@ -303,31 +302,25 @@ static void conv_opt_walker(ir_node *node, void *data)
}
}
static ir_graph_properties_t do_deconv(ir_graph *irg)
void conv_opt(ir_graph *irg)
{
bool global_changed = false;
bool changed;
FIRM_DBG_REGISTER(dbg, "firm.opt.conv");
assure_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_OUT_EDGES);
DB((dbg, LEVEL_1, "===> Performing conversion optimization on %+F\n", irg));
do {
changed = false;
irg_walk_graph(irg, NULL, conv_opt_walker, &changed);
local_optimize_graph(irg);
global_changed |= changed;
} while (changed);