diff mbox

[2/6] Rename make_restrict_var_constraints to make_param_constraints

Message ID 562F72A9.6080401@mentor.com
State New
Headers show

Commit Message

Tom de Vries Oct. 27, 2015, 12:48 p.m. UTC
On 27/10/15 13:24, Tom de Vries wrote:
> Thinking it over a bit more, I realized the constraint handling started
> to be messy. I've reworked the patch series to simplify that first.
>
>       1    Simplify constraint handling
>       2    Rename make_restrict_var_constraints to make_param_constraints
>       3    Add recursion to make_param_constraints
>       4    Add handle_param parameter to create_variable_info_for_1
>       5    Handle recursive restrict pointer in create_variable_info_for_1
>       6    Handle restrict struct fields recursively
>
> Currently doing bootstrap and regtest on x86_64.
>
> I'll repost the patch series in reply to this message.
>

This no-functional-changes patch:
- moves the one constraint handling loop left in
   intra_create_variable_infos to make_restrict_var_constraints
- renames make_restrict_var_constraints to make_param_constraints
- adds a parameter toplevel to make_param_constraints to distinguish
   between the two calling contexts

Thanks,
- Tom

Comments

Richard Biener Oct. 28, 2015, 3:38 p.m. UTC | #1
On Tue, 27 Oct 2015, Tom de Vries wrote:

> On 27/10/15 13:24, Tom de Vries wrote:
> > Thinking it over a bit more, I realized the constraint handling started
> > to be messy. I've reworked the patch series to simplify that first.
> > 
> >       1    Simplify constraint handling
> >       2    Rename make_restrict_var_constraints to make_param_constraints
> >       3    Add recursion to make_param_constraints
> >       4    Add handle_param parameter to create_variable_info_for_1
> >       5    Handle recursive restrict pointer in create_variable_info_for_1
> >       6    Handle restrict struct fields recursively
> > 
> > Currently doing bootstrap and regtest on x86_64.
> > 
> > I'll repost the patch series in reply to this message.
> > 
> 
> This no-functional-changes patch:
> - moves the one constraint handling loop left in
>   intra_create_variable_infos to make_restrict_var_constraints
> - renames make_restrict_var_constraints to make_param_constraints
> - adds a parameter toplevel to make_param_constraints to distinguish
>   between the two calling contexts

Please pass in the name "PARAM_RESTRICT" vs. "GLOBAL_RESTRICT" instead.

> Thanks,
> - Tom
>
diff mbox

Patch

Rename make_restrict_var_constraints to make_param_constraints

2015-10-27  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-structalias.c (make_restrict_var_constraints): Rename to ...
	(make_param_constraints): ... this.  Add toplevel parameter.
	(intra_create_variable_infos): Use make_param_constraints.
---
 gcc/tree-ssa-structalias.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 4610914..e88fbf0 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5845,18 +5845,29 @@  debug_solution_for_var (unsigned int var)
   dump_solution_for_var (stderr, var);
 }
 
-/* Register the constraints for restrict var VI.  */
+/* Register the constraints for VI.  If TOPLEVEL then VI is a function
+   parameter, otherwise VI is part of a function parameter.  */
 
 static void
-make_restrict_var_constraints (varinfo_t vi)
+make_param_constraints (varinfo_t vi, bool toplevel)
 {
   for (; vi; vi = vi_next (vi))
     if (vi->may_have_pointers)
       {
 	if (vi->only_restrict_pointers)
-	  make_constraint_from_global_restrict (vi, "GLOBAL_RESTRICT");
+	  {
+	    if (toplevel)
+	      make_constraint_from_global_restrict (vi, "PARM_RESTRICT");
+	    else
+	      make_constraint_from_global_restrict (vi, "GLOBAL_RESTRICT");
+	  }
 	else
-	  make_copy_constraint (vi, nonlocal_id);
+	  {
+	    if (toplevel)
+	      make_constraint_from (vi, nonlocal_id);
+	    else
+	      make_copy_constraint (vi, nonlocal_id);
+	  }
       }
 }
 
@@ -5900,17 +5911,11 @@  intra_create_variable_infos (struct function *fn)
 	  vi->is_restrict_var = 1;
 	  insert_vi_for_tree (heapvar, vi);
 	  make_constraint_from (p, vi->id);
-	  make_restrict_var_constraints (vi);
+	  make_param_constraints (vi, false);
 	  continue;
 	}
 
-      for (; p; p = vi_next (p))
-	{
-	  if (p->only_restrict_pointers)
-	    make_constraint_from_global_restrict (p, "PARM_RESTRICT");
-	  else if (p->may_have_pointers)
-	    make_constraint_from (p, nonlocal_id);
-	}
+      make_param_constraints (p, true);
     }
 
   /* Add a constraint for a result decl that is passed by reference.  */
-- 
1.9.1