* @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"
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
/* 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. */