summaryrefslogtreecommitdiff
path: root/gcc/graphite-clast-to-gimple.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/graphite-clast-to-gimple.c')
-rw-r--r--gcc/graphite-clast-to-gimple.c79
1 files changed, 9 insertions, 70 deletions
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 795bb6a678b..693e61c2a43 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -76,7 +76,7 @@ pbb_to_depth_to_oldiv (poly_bb_p pbb, int depth)
sese region = SCOP_REGION (PBB_SCOP (pbb));
loop_p loop = gbb_loop_at_index (gbb, region, depth);
- return (tree) loop->aux;
+ return loop->single_iv;
}
/* For a given scattering dimension, return the new induction variable
@@ -1109,43 +1109,6 @@ debug_generated_program (scop_p scop)
print_generated_program (stderr, scop);
}
-/* A LOOP is in normal form for Graphite when it contains only one
- scalar phi node that defines the main induction variable of the
- loop, only one increment of the IV, and only one exit condition. */
-
-static void
-graphite_loop_normal_form (loop_p loop)
-{
- struct tree_niter_desc niter;
- tree nit;
- gimple_seq stmts;
- edge exit = single_dom_exit (loop);
-
- bool known_niter = number_of_iterations_exit (loop, exit, &niter, false);
-
- /* At this point we should know the number of iterations, */
- gcc_assert (known_niter);
-
- nit = force_gimple_operand (unshare_expr (niter.niter), &stmts, true,
- NULL_TREE);
- if (stmts)
- gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
-
- loop->aux = canonicalize_loop_ivs (loop, &nit);
-}
-
-/* Converts REGION to loop normal form: one induction variable per loop. */
-
-static void
-build_graphite_loop_normal_form (sese region)
-{
- int i;
- loop_p loop;
-
- for (i = 0; VEC_iterate (loop_p, SESE_LOOP_NEST (region), i, loop); i++)
- graphite_loop_normal_form (loop);
-}
-
/* GIMPLE Loop Generator: generates loops from STMT in GIMPLE form for
the given SCOP. Return true if code generation succeeded.
BB_PBB_MAPPING is a basic_block and it's related poly_bb_p mapping.
@@ -1173,7 +1136,6 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
fprintf (dump_file, "\n");
}
- build_graphite_loop_normal_form (region);
recompute_all_dominators ();
graphite_verify ();
@@ -1234,23 +1196,6 @@ find_pbb_via_hash (htab_t bb_pbb_mapping, basic_block bb)
return NULL;
}
-/* Free loop->aux in newly created loops by translate_clast. */
-
-void
-free_aux_in_new_loops (void)
-{
- loop_p loop;
- loop_iterator li;
-
- FOR_EACH_LOOP (li, loop, 0)
- {
- if (!loop->aux)
- continue;
- free(loop->aux);
- loop->aux = NULL;
- }
-}
-
/* Check data dependency in LOOP. BB_PBB_MAPPING is a basic_block and
it's related poly_bb_p mapping.
*/
@@ -1302,22 +1247,16 @@ void mark_loops_parallel (htab_t bb_pbb_mapping)
int num_no_dependency = 0;
FOR_EACH_LOOP (li, loop, 0)
- {
- if (!loop->aux)
- continue;
-
- if (!dependency_in_loop_p (loop, bb_pbb_mapping))
- {
- loop->can_be_parallel = true;
- num_no_dependency++;
- }
- }
+ if (loop->aux
+ && !dependency_in_loop_p (loop, bb_pbb_mapping))
+ {
+ loop->can_be_parallel = true;
+ num_no_dependency++;
+ }
if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "\n%d loops carried no dependency.\n",
- num_no_dependency);
- }
+ fprintf (dump_file, "\n%d loops carried no dependency.\n",
+ num_no_dependency);
}
#endif