unsigned int nb_deps_not_carried_by_i, nb_deps_not_carried_by_j;
struct data_dependence_relation *ddr;
+ if (VEC_length (ddr_p, dependence_relations) == 0)
+ return trans;
+
/* When there is an unknown relation in the dependence_relations, we
know that it is no worth looking at this loop nest: give up. */
ddr = VEC_index (ddr_p, dependence_relations, 0);
void
linear_transform_loops (struct loops *loops)
{
+ bool modified = false;
unsigned int i;
VEC(tree,heap) *oldivs = NULL;
VEC(tree,heap) *invariants = NULL;
lambda_loopnest before, after;
lambda_trans_matrix trans;
bool problem = false;
- bool need_perfect_nest = false;
/* If it's not a loop nest, we don't want it.
We also don't handle sibling loops properly,
which are loops of the following form:
datarefs = VEC_alloc (data_reference_p, heap, 10);
dependence_relations = VEC_alloc (ddr_p, heap, 10 * 10);
- compute_data_dependences_for_loop (loop_nest, true, datarefs,
- dependence_relations);
+ compute_data_dependences_for_loop (loop_nest, true, &datarefs,
+ &dependence_relations);
if (dump_file && (dump_flags & TDF_DETAILS))
dump_ddrs (dump_file, dependence_relations);
continue;
}
- if (!perfect_nest_p (loop_nest))
- need_perfect_nest = true;
+ before = gcc_loopnest_to_lambda_loopnest (loops, loop_nest, &oldivs,
+ &invariants);
- before = gcc_loopnest_to_lambda_loopnest (loops,
- loop_nest, &oldivs,
- &invariants,
- need_perfect_nest);
if (!before)
continue;
lambda_loopnest_to_gcc_loopnest (loop_nest, oldivs, invariants,
after, trans);
+ modified = true;
if (dump_file)
fprintf (dump_file, "Successfully transformed loop.\n");
VEC_free (tree, heap, oldivs);
VEC_free (tree, heap, invariants);
scev_reset ();
- rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_full_phi);
+
+ if (modified)
+ rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_full_phi);
}