diff mbox series

[16/40] graphite: Rename isl_id_for_ssa_name

Message ID 20211215155447.19379-17-frederik@codesourcery.com
State New
Headers show
Series OpenACC "kernels" Improvements | expand

Commit Message

Frederik Harwath Dec. 15, 2021, 3:54 p.m. UTC
The SSA names for which this function gets used are always SCoP
parameters and hence "isl_id_for_parameter" is a better name.  It also
explains the prefix "P_" for those names in the ISL representation.

gcc/ChangeLog:

        * graphite-sese-to-poly.c (isl_id_for_ssa_name): Rename to ...
          (isl_id_for_parameter): ... this new function name.
          (build_scop_context): Adjust function use.
---
 gcc/graphite-sese-to-poly.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

--
2.33.0

-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

Comments

Tobias Burnus May 16, 2022, 12:49 p.m. UTC | #1
Rediffed Frederik's patch. Actual change is just s/.c/.cc/ but also a
missing space → tab.

On 15.12.21 16:54, Frederik Harwath wrote:
> The SSA names for which this function gets used are always SCoP
> parameters and hence "isl_id_for_parameter" is a better name.  It also
> explains the prefix "P_" for those names in the ISL representation.

OK for mainline?

Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
Richard Biener May 17, 2022, 8:22 a.m. UTC | #2
On Mon, 16 May 2022, Tobias Burnus wrote:

> Rediffed Frederik's patch. Actual change is just s/.c/.cc/ but also a
> missing space ? tab.
> 
> On 15.12.21 16:54, Frederik Harwath wrote:
> > The SSA names for which this function gets used are always SCoP
> > parameters and hence "isl_id_for_parameter" is a better name.  It also
> > explains the prefix "P_" for those names in the ISL representation.
> 
> OK for mainline?

OK.

Richard.

> Tobias
> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstra?e 201, 80634
> M?nchen; Gesellschaft mit beschr?nkter Haftung; Gesch?ftsf?hrer: Thomas
> Heurung, Frank Th?rauf; Sitz der Gesellschaft: M?nchen; Registergericht
> M?nchen, HRB 106955
>
diff mbox series

Patch

diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 99ea0327b1a7..204d382ed4cc 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -100,14 +100,15 @@  extract_affine_mul (scop_p s, tree e, __isl_take isl_space *space)
   return isl_pw_aff_mul (lhs, rhs);
 }

-/* Return an isl identifier from the name of the ssa_name E.  */
+/* Return an isl identifier for the parameter P.  */

 static isl_id *
-isl_id_for_ssa_name (scop_p s, tree e)
+isl_id_for_parameter (scop_p s, tree p)
 {
-  char name1[14];
-  snprintf (name1, sizeof (name1), "P_%d", SSA_NAME_VERSION (e));
-  return isl_id_alloc (s->isl_context, name1, e);
+  gcc_checking_assert (TREE_CODE (p) == SSA_NAME);
+  char name[14];
+  snprintf (name, sizeof (name), "P_%d", SSA_NAME_VERSION (p));
+  return isl_id_alloc (s->isl_context, name, p);
 }

 /* Return an isl identifier for the data reference DR.  Data references and
@@ -898,15 +899,15 @@  build_scop_context (scop_p scop)
   isl_space *space = isl_space_set_alloc (scop->isl_context, nbp, 0);

   unsigned i;
-  tree e;
-  FOR_EACH_VEC_ELT (region->params, i, e)
+  tree p;
+  FOR_EACH_VEC_ELT (region->params, i, p)
     space = isl_space_set_dim_id (space, isl_dim_param, i,
-                                  isl_id_for_ssa_name (scop, e));
+                                  isl_id_for_parameter (scop, p));

   scop->param_context = isl_set_universe (space);

-  FOR_EACH_VEC_ELT (region->params, i, e)
-    add_param_constraints (scop, i, e);
+  FOR_EACH_VEC_ELT (region->params, i, p)
+    add_param_constraints (scop, i, p);
 }

 /* Return true when loop A is nested in loop B.  */