diff options
author | Sebastian Pop <sebastian.pop@amd.com> | 2009-11-25 05:24:14 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2009-11-25 05:24:14 +0000 |
commit | 8e6ef139122f2f2209b7cde869b36de3f68dc82f (patch) | |
tree | 43aa80487a924b18f9032cc266bc872122717ff4 /gcc/graphite-clast-to-gimple.c | |
parent | e6dd91b2baa1f73acdd1d6063abe18d3a6942b0d (diff) | |
download | gcc-8e6ef139122f2f2209b7cde869b36de3f68dc82f.tar.gz |
cfgloop.c (alloc_loop): Initialize loop->single_iv.
2009-10-22 Sebastian Pop <sebastian.pop@amd.com>
* cfgloop.c (alloc_loop): Initialize loop->single_iv.
* cfgloop.h (struct loop): New field single_iv.
* graphite-clast-to-gimple.c (pbb_to_depth_to_oldiv): Do not use
loop->aux anymore: use loop->single_iv.
(graphite_loop_normal_form): Moved...
(build_graphite_loop_normal_form): Removed.
(gloog): Do not call build_graphite_loop_normal_form.
(free_aux_in_new_loops): Moved...
(mark_loops_parallel): Restructure.
* graphite-clast-to-gimple.h (free_aux_in_new_loops): Do not declare.
* graphite-sese-to-poly.c (graphite_loop_normal_form): ...here.
(scop_canonicalize_loops): New.
(build_poly_scop): Call scop_canonicalize_loops.
* graphite.c (free_aux_in_new_loops): ...here.
From-SVN: r154624
Diffstat (limited to 'gcc/graphite-clast-to-gimple.c')
-rw-r--r-- | gcc/graphite-clast-to-gimple.c | 79 |
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 |