* @file
* @brief Combining congruent blocks
* @author Michael Beck
- * @version $Id$
*
* This phase find congruent blocks.
* Two block are congruent, if they contains only equal calculations.
key.id = id;
key.list = NULL;
key.next = NULL;
- entry = (listmap_entry_t*)set_insert(map->map, &key, sizeof(key), HASH_PTR(id));
+ entry = (listmap_entry_t*)set_insert(map->map, &key, sizeof(key), hash_ptr(id));
if (entry->list == NULL) {
/* a new entry, put into the list */
static unsigned opcode_hash(const opcode_key_t *entry)
{
/* assume long >= int */
- return (unsigned)(PTR_TO_INT(entry->mode) * 9 + entry->code + entry->u.proj * 3 + HASH_PTR(entry->u.addr) + entry->arity);
+ return (unsigned)(PTR_TO_INT(entry->mode) * 9 + entry->code + entry->u.proj * 3 + hash_ptr(entry->u.addr) + entry->arity);
} /* opcode_hash */
/**
#endif /* GENERAL_SHAPE */
/* Combines congruent end blocks into one. */
-int shape_blocks(ir_graph *irg)
+void shape_blocks(ir_graph *irg)
{
environment_t env;
partition_t *part;
if (res) {
/* control flow changed */
- clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE
- | IR_GRAPH_STATE_VALID_EXTENDED_BLOCKS);
+ clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
}
for (bl = env.all_blocks; bl != NULL; bl = bl->all_next) {
DEL_ARR_F(env.live_outs);
del_set(env.opcode2id_map);
obstack_free(&env.obst, NULL);
-
- return res;
} /* shape_blocks */
ir_graph_pass_t *shape_blocks_pass(const char *name)
{
- return def_graph_pass_ret(name ? name : "shape_blocks", shape_blocks);
+ return def_graph_pass(name ? name : "shape_blocks", shape_blocks);
} /* shape_blocks_pass */