Start counting nesting level from 0 and use the standard "Polyhedral SCattering Trans...
authorSebastian Pop <sebastian.pop@amd.com>
Thu, 21 Jul 2011 22:56:29 +0000 (22:56 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Thu, 21 Jul 2011 22:56:29 +0000 (22:56 +0000)
2011-07-21  Sebastian Pop  <sebastian.pop@amd.com>

* graphite-clast-to-gimple.c (compute_bounds_for_level): Call
psct_dynamic_dim.
(translate_clast_for_loop): Pass loop level to dependency_in_loop_p.
(gcc_type_for_iv_of_clast_loop): Update use of level.
(gloog): Start counting nesting level from 0.
* graphite-clast-to-gimple.h (get_scattering_level): Removed.
* graphite-dependences.c (graphite_carried_dependence_level_k): Call
psct_dynamic_dim on level.

From-SVN: r176596

gcc/ChangeLog
gcc/graphite-clast-to-gimple.c
gcc/graphite-clast-to-gimple.h
gcc/graphite-dependences.c

index 3daa0727f163afe182fa9f89cfd90b4a776e9415..cb2ceb44f7fc48d32fde7cf8c5be7613c8359c8c 100644 (file)
@@ -1,3 +1,14 @@
+2011-07-21  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * graphite-clast-to-gimple.c (compute_bounds_for_level): Call
+       psct_dynamic_dim.
+       (translate_clast_for_loop): Pass loop level to dependency_in_loop_p.
+       (gcc_type_for_iv_of_clast_loop): Update use of level.
+       (gloog): Start counting nesting level from 0.
+       * graphite-clast-to-gimple.h (get_scattering_level): Removed.
+       * graphite-dependences.c (graphite_carried_dependence_level_k): Call
+       psct_dynamic_dim on level.
+
 2011-07-21  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.c (ix86_legitimize_address): Convert to
index 6b17631e40853ba63d6793ef72c163ceebe5edf4..53af18ebdf6a13b06baf8d5946f1a6793e117ff0 100644 (file)
@@ -622,7 +622,7 @@ compute_bounds_for_level (poly_bb_p pbb, int level, mpz_t low, mpz_t up)
       + pbb_dim_iter_domain (pbb) + pbb_nb_params (pbb);
 
     ppl_new_Linear_Expression_with_dimension (&le, dim);
-    ppl_set_coef (le, 2 * level + 1, 1);
+    ppl_set_coef (le, psct_dynamic_dim (pbb, level), 1);
   }
 
   ppl_max_for_le_pointset (ps, le, up);
@@ -687,7 +687,7 @@ gcc_type_for_iv_of_clast_loop (struct clast_for *stmt_for, int level,
 
   return max_signed_precision_type (lb_type, max_precision_type
                                    (ub_type, compute_type_for_level
-                                    (pbb, level - 1)));
+                                    (pbb, level)));
 }
 
 /* Creates a new LOOP corresponding to Cloog's STMT.  Inserts an
@@ -803,7 +803,7 @@ find_pbb_via_hash (htab_t bb_pbb_mapping, basic_block bb)
   return NULL;
 }
 
-/* Check data dependency in LOOP at scattering level LEVEL.
+/* Check data dependency in LOOP at level LEVEL.
    BB_PBB_MAPPING is a basic_block and it's related poly_bb_p
    mapping.  */
 
@@ -961,8 +961,7 @@ translate_clast_for_loop (sese region, loop_p context_loop,
   set_immediate_dominator (CDI_DOMINATORS, next_e->dest, next_e->src);
 
   if (flag_loop_parallelize_all
-      && !dependency_in_loop_p (loop, bb_pbb_mapping,
-                               get_scattering_level (level)))
+      && !dependency_in_loop_p (loop, bb_pbb_mapping, level))
     loop->can_be_parallel = true;
 
   return last_e;
@@ -1477,7 +1476,7 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
   translate_clast (region, context_loop, pc.stmt,
                   if_region->true_region->entry,
                   &newivs, newivs_index,
-                  bb_pbb_mapping, 1, params_index);
+                  bb_pbb_mapping, 0, params_index);
   graphite_verify ();
   scev_reset ();
   recompute_all_dominators ();
index 9d599d6d0754e6592849b629a5ed6fd097cc881b..b5affd989f0acb72c697f427cd4014013067fa5e 100644 (file)
@@ -63,16 +63,4 @@ eq_bb_pbb_map (const void *bb_pbb1, const void *bb_pbb2)
   return (bp1->bb->index == bp2->bb->index);
 }
 
-/* Returns the scattering dimension for STMTFOR.
-
-   The relationship between dimension in scattering matrix
-   and the DEPTH of the loop is:
-   DIMENSION = 2*DEPTH - 1
-*/
-
-static inline int get_scattering_level (int depth)
-{
-  return 2 * depth - 1;
-}
-
 #endif
index 081aa691ba6dec0d86c753e544f6bf1f7ba4c312..fb49f161480876635054d5f24642a401fa6505b3 100644 (file)
@@ -745,11 +745,13 @@ graphite_carried_dependence_level_k (poly_dr_p pdr1, poly_dr_p pdr2,
 {
   ppl_Pointset_Powerset_C_Polyhedron_t po;
   ppl_Pointset_Powerset_C_Polyhedron_t eqpp;
-  graphite_dim_t tdim1 = pbb_nb_scattering_transform (PDR_PBB (pdr1));
-  graphite_dim_t ddim1 = pbb_dim_iter_domain (PDR_PBB (pdr1));
+  poly_bb_p pbb = PDR_PBB (pdr1);
+  graphite_dim_t tdim1 = pbb_nb_scattering_transform (pbb);
+  graphite_dim_t ddim1 = pbb_dim_iter_domain (pbb);
   ppl_dimension_type dim;
   bool empty_p;
   poly_ddr_p pddr = new_poly_ddr (pdr1, pdr2, 1, false);
+  graphite_dim_t pos;
 
   if (PDDR_KIND (pddr) == unknown_dependence)
     {
@@ -765,7 +767,8 @@ graphite_carried_dependence_level_k (poly_dr_p pdr1, poly_dr_p pdr2,
 
   po = PDDR_DDP (pddr);
   ppl_Pointset_Powerset_C_Polyhedron_space_dimension (po, &dim);
-  eqpp = build_pairwise_scheduling (dim, level, tdim1 + ddim1, 1);
+  pos = psct_dynamic_dim (pbb, level);
+  eqpp = build_pairwise_scheduling (dim, pos, tdim1 + ddim1, 1);
 
   ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (eqpp, po);
   empty_p = ppl_powerset_is_empty (eqpp);