X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fboolopt.c;h=1ca652717ec2f9f8dfded0c46038c3c3a30a9b77;hb=623a89e25bce0fa58ab7cef147fc08f3a56ead6b;hp=74dfc326fcfe51efae62f3c23670cc8e27de90e1;hpb=7d5b331123bd8399f5f1d057e90797faa3300b66;p=libfirm diff --git a/ir/opt/boolopt.c b/ir/opt/boolopt.c index 74dfc326f..1ca652717 100644 --- a/ir/opt/boolopt.c +++ b/ir/opt/boolopt.c @@ -21,7 +21,6 @@ * @file * @brief boolean condition/control flow optimizations * @author Matthias Braun, Christoph Mallon, Michael Beck - * @version $Id: cfopt.c 22579 2008-10-07 14:54:04Z beck $ */ #include "config.h" @@ -39,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 { @@ -717,10 +715,9 @@ restart: } } -static ir_graph_state_t do_simplify_bool(ir_graph *const irg) +void opt_bool(ir_graph *const irg) { bool_opt_env_t env; - ir_graph_state_t res = 0; /* register a debug mask */ FIRM_DBG_REGISTER(dbg, "firm.opt.bool"); @@ -730,30 +727,14 @@ static ir_graph_state_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_STATE_CONSISTENT_DOMINANCE; - } - ir_free_resources(irg, IR_RESOURCE_BLOCK_MARK | IR_RESOURCE_PHI_LIST); - return res; -} - -optdesc_t opt_simplify_bool = { - "bool-simplification", - IR_GRAPH_STATE_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. */