* @brief Backend IRG modification routines.
* @author Sebastian Hack, Daniel Grund, Matthias Braun, Christian Wuerdig
* @date 04.05.2005
- * @version $Id$
*
* This file contains the following IRG modifications for be routines:
* - insertion of Perm nodes
*/
static void remove_empty_block(ir_node *block)
{
- const ir_edge_t *edge, *next;
- int i, arity;
- ir_node *node;
- ir_node *pred;
- ir_node *succ_block;
- ir_node *jump = NULL;
- ir_graph *irg = get_irn_irg(block);
+ const ir_edge_t *edge;
+ const ir_edge_t *next;
+ int i;
+ int arity;
+ ir_node *node;
+ ir_node *pred;
+ ir_node *succ_block;
+ ir_node *jump = NULL;
+ ir_graph *irg = get_irn_irg(block);
+ ir_entity *entity;
if (irn_visited_else_mark(block))
return;
if (jump == NULL)
goto check_preds;
+ entity = get_Block_entity(block);
pred = get_Block_cfgpred(block, 0);
succ_block = NULL;
foreach_out_edge_safe(jump, edge, next) {
assert(succ_block == NULL);
succ_block = get_edge_src_irn(edge);
- if (has_Block_entity(succ_block) && has_Block_entity(block)) {
+ if (get_Block_entity(succ_block) != NULL && entity != NULL) {
/*
* Currently we can add only one label for a block.
* Therefore we cannot combine them if both block already have one.
set_irn_n(succ_block, pos, pred);
}
- if (has_Block_entity(block)) {
+ if (entity != NULL) {
/* move the label to the successor block */
- ir_entity *entity = get_Block_entity(block);
set_Block_entity(succ_block, entity);
}
if (blocks_removed) {
/* invalidate analysis info */
- clear_irg_state(irg, IR_GRAPH_STATE_CONSISTENT_DOMINANCE);
- set_irg_extblk_inconsistent(irg);
+ clear_irg_properties(irg, IR_GRAPH_PROPERTY_CONSISTENT_DOMINANCE);
}
return blocks_removed;
}