X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fopt%2Fboolopt.c;h=1ca652717ec2f9f8dfded0c46038c3c3a30a9b77;hb=5d0dc80583152b7e75989b205755bdb0cd1ce0aa;hp=3e633bb35c0b1f84e73655cab58de017c29e3869;hpb=ae9fd2c229cc7f4c724ce9ccc9263c16d77670fe;p=libfirm diff --git a/ir/opt/boolopt.c b/ir/opt/boolopt.c index 3e633bb35..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" @@ -56,7 +55,7 @@ typedef struct { int changed; /**< Set if the graph was changed. */ } bool_opt_env_t; -DEBUG_ONLY(static firm_dbg_module_t *dbg); +DEBUG_ONLY(static firm_dbg_module_t *dbg;) /** * Check if tho given nodes, l and r, represent two compares with @@ -723,27 +722,19 @@ void opt_bool(ir_graph *const irg) /* register a debug mask */ FIRM_DBG_REGISTER(dbg, "firm.opt.bool"); - /* works better with one return block only */ - normalize_one_return(irg); - env.changed = 0; /* 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) { - set_irg_doms_inconsistent(irg); - set_irg_extblk_inconsistent(irg); - set_irg_loopinfo_inconsistent(irg); - } - ir_free_resources(irg, IR_RESOURCE_BLOCK_MARK | IR_RESOURCE_PHI_LIST); + + confirm_irg_properties(irg, + env.changed ? IR_GRAPH_PROPERTIES_NONE : IR_GRAPH_PROPERTIES_ALL); } /* Creates an ir_graph pass for opt_bool. */