{
int i;
int n_cfgpreds;
- ir_graph *irg;
+ ir_graph *irg = get_irn_irg(block);
ir_node *phi;
ir_node **in;
* Dead and bad blocks. */
if (get_irn_arity(block) < 1 || is_Bad(block)) {
DB((dbg, LEVEL_5, "ssa bad %N\n", block));
- return new_Bad();
+ return new_r_Bad(irg, mode);
}
if (block == ssa_second_def_block && !first) {
return value;
}
- irg = get_irn_irg(block);
assert(block != get_irg_start_block(irg));
/* a Block with only 1 predecessor needs no Phi */
* (Some blocks need to be removed once again.)
* Returns 1 if the given block belongs to the condition chain.
*/
-static unsigned find_condition_chain(ir_node *block)
+static void find_condition_chain(ir_node *block)
{
const ir_edge_t *edge;
unsigned mark = 0;
* continuing with another subtree. */
if (loop_info.cc_size + nodes_n > opt_params.max_cc_size) {
set_Block_mark(block, 0);
- return 0;
+ return;
}
/* Check if block only has a jmp instruction. */
if (is_in_loop(src) && ! irn_visited(src))
find_condition_chain(src);
}
-
- return mark;
}
/**
int depth_adaption = opt_params.depth_adaption;
unsigned do_inversion = 1;
- unsigned has_cc = 0;
/* Depth of 0 is the procedure and 1 a topmost loop. */
loop_depth = get_loop_depth(cur_loop) - 1;
/* Search for condition chains and temporarily save the blocks in an array. */
cc_blocks = NEW_ARR_F(ir_node *, 0);
inc_irg_visited(current_ir_graph);
- has_cc = find_condition_chain(loop_head);
+ find_condition_chain(loop_head);
unmark_not_allowed_cc_blocks();
DEL_ARR_F(cc_blocks);
/* Duplicated blocks changed doms */
set_irg_doms_inconsistent(current_ir_graph);
- /* Loop content changed */
- set_irg_loopinfo_inconsistent(current_ir_graph);
- /* TODO are they? Depends on set_irn_in and set_irn_n exchange and new_node. */
- set_irg_outs_inconsistent(current_ir_graph);
count_stats(stats.inverted);
}
{
ir_node *projres, *loop_condition, *iteration_path;
- unsigned success, is_latest_val;
+ unsigned success;
ir_tarval *step_tar;
ir_mode *mode;
* Until now we only have end_val. */
if (is_Add(iteration_path) || is_Sub(iteration_path)) {
- /* We test against the latest value of the iv. */
- is_latest_val = 1;
-
loop_info.add = iteration_path;
DB((dbg, LEVEL_4, "Case 1: Got add %N (maybe not sane)\n", loop_info.add));
} else if (is_Phi(iteration_path)) {
ir_node *new_iteration_phi;
- /* We compare with the value the iv had entering this run. */
- is_latest_val = 0;
-
loop_info.iteration_phi = iteration_path;
DB((dbg, LEVEL_4, "Case 2: Got phi %N\n", loop_info.iteration_phi));
count_stats(stats.invariant_unroll);
set_irg_doms_inconsistent(current_ir_graph);
- set_irg_loopinfo_inconsistent(current_ir_graph);
- /* TODO is it? */
- set_irg_outs_inconsistent(current_ir_graph);
DEL_ARR_F(loop_entries);
}