This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, 3/6] Add recursion to make_param_constraints
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Date: Tue, 3 Nov 2015 00:28:48 +0100
- Subject: Re: [PATCH, 3/6] Add recursion to make_param_constraints
- Authentication-results: sourceware.org; auth=none
- References: <562E0CF5 dot 8000606 at mentor dot com> <CAFiYyc20gSLqPSyF9-_xYjN7-RPB2xqsfuM4j45XNU4fv-R8Eg at mail dot gmail dot com> <562E5381 dot 5 at mentor dot com> <562F26E2 dot 40906 at mentor dot com> <562F6D1A dot 4010001 at mentor dot com> <562F748D dot 5020507 at mentor dot com> <563653F5 dot 9090302 at mentor dot com> <5636561E dot 2030200 at mentor dot com> <alpine dot LSU dot 2 dot 11 dot 1511021622240 dot 10078 at zhemvz dot fhfr dot qr>
On 02/11/15 16:25, Richard Biener wrote:
On Sun, 1 Nov 2015, Tom de Vries wrote:
>On 01/11/15 19:03, Tom de Vries wrote:
> >
> >So, the new patch series is:
> >
> > 1 Rename make_restrict_var_constraints to make_param_constraints
> > 2 Handle recursive restrict in function parameter
> >
> >I'll repost 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
>- adds a parmeter restrict_name that allows to pass in the name of
> restrict vars
>
>This patch was posted before at
>https://gcc.gnu.org/ml/gcc-patches/2015-10/msg03111.html .
+ if (toplevel)
+ make_constraint_from (vi, nonlocal_id);
+ else
+ make_copy_constraint (vi, nonlocal_id);
I think make_constraint_from is what we want in both cases.
Committed as separate patch, as attached (1st patch).
Ok with this change (thus drop the toplevel parameter).
Committed as attached (2nd patch).
Thanks,
- Tom
Replace make_copy_constraint with make_constraint_from in make_restrict_var_constraints
2015-11-02 Tom de Vries <tom@codesourcery.com>
* tree-ssa-structalias.c (make_restrict_var_constraints): Replace
make_copy_constraint call with make_constraint_from call.
---
gcc/tree-ssa-structalias.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 55f72a2..773731d 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5890,7 +5890,7 @@ make_restrict_var_constraints (varinfo_t vi)
if (vi->only_restrict_pointers)
make_constraint_from_global_restrict (vi, "GLOBAL_RESTRICT", true);
else
- make_copy_constraint (vi, nonlocal_id);
+ make_constraint_from (vi, nonlocal_id);
}
}
--
1.9.1
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 and handle restrict_name
parameter. Handle is_full_var case.
(intra_create_variable_infos): Use make_param_constraints.
---
gcc/tree-ssa-structalias.c | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 773731d..ded5a1e 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -5879,19 +5879,22 @@ debug_solution_for_var (unsigned int var)
dump_solution_for_var (stderr, var);
}
-/* Register the constraints for restrict var VI. */
+/* Register the constraints for function parameter related VI. Use RESTRICT_NAME
+ as the base name of created restrict vars. */
static void
-make_restrict_var_constraints (varinfo_t vi)
+make_param_constraints (varinfo_t vi, const char *restrict_name)
{
for (; vi; vi = vi_next (vi))
- if (vi->may_have_pointers)
- {
- if (vi->only_restrict_pointers)
- make_constraint_from_global_restrict (vi, "GLOBAL_RESTRICT", true);
- else
- make_constraint_from (vi, nonlocal_id);
- }
+ {
+ if (vi->only_restrict_pointers)
+ make_constraint_from_global_restrict (vi, restrict_name, true);
+ else if (vi->may_have_pointers)
+ make_constraint_from (vi, nonlocal_id);
+
+ if (vi->is_full_var)
+ break;
+ }
}
/* Create varinfo structures for all of the variables in the
@@ -5928,19 +5931,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, "GLOBAL_RESTRICT");
continue;
}
- for (; p; p = vi_next (p))
- {
- if (p->only_restrict_pointers)
- make_constraint_from_global_restrict (p, "PARM_RESTRICT", true);
- else if (p->may_have_pointers)
- make_constraint_from (p, nonlocal_id);
- if (p->is_full_var)
- break;
- }
+ make_param_constraints (p, "PARM_RESTRICT");
}
/* Add a constraint for a result decl that is passed by reference. */
--
1.9.1