public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom de Vries <Tom_deVries@mentor.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Richard Biener <rguenther@suse.de>,
	"gcc-patches@gnu.org"	<gcc-patches@gnu.org>
Subject: [PATCH, 2/6] Rename make_restrict_var_constraints to make_param_constraints
Date: Tue, 27 Oct 2015 12:50:00 -0000	[thread overview]
Message-ID: <562F72A9.6080401@mentor.com> (raw)
In-Reply-To: <562F6D1A.4010001@mentor.com>

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

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

[-- Attachment #2: 0002-Rename-make_restrict_var_constraints-to-make_param_c.patch --]
[-- Type: text/x-patch, Size: 2208 bytes --]

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


  parent reply	other threads:[~2015-10-27 12:49 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 11:23 [PATCH, 1/2] Add handle_param parameter to create_variable_info_for_1 Tom de Vries
2015-10-26 13:46 ` Richard Biener
2015-10-26 16:26   ` Tom de Vries
2015-10-27  7:59     ` [PATCH, PR67742] Handle restrict struct fields recursively Tom de Vries
2015-10-27 12:26       ` Tom de Vries
2015-10-27 12:49         ` [PATCH, 1/6] Simplify constraint handling Tom de Vries
2015-10-28 15:38           ` Richard Biener
2015-10-28 16:06             ` Tom de Vries
2015-10-28 21:32               ` Tom de Vries
2015-10-29 11:16               ` Richard Biener
2015-10-29 12:31                 ` Tom de Vries
2015-10-29 13:15                   ` Richard Biener
2015-10-29 16:10                     ` Tom de Vries
2015-10-30  9:44                       ` Richard Biener
2015-10-31  8:24                         ` Tom de Vries
2015-10-31  9:44                           ` [committed, trivial] Don't expect existing varinfo for arguments in intra_create_variable_infos Tom de Vries
2015-10-27 12:50         ` Tom de Vries [this message]
2015-10-28 15:45           ` [PATCH, 2/6] Rename make_restrict_var_constraints to make_param_constraints Richard Biener
2015-10-28 21:56             ` Tom de Vries
2015-10-27 13:04         ` [PATCH, 3/6] Add recursion " Tom de Vries
2015-11-01 18:04           ` Tom de Vries
2015-11-01 18:13             ` Tom de Vries
2015-11-02 15:25               ` Richard Biener
2015-11-02 23:29                 ` Tom de Vries
2015-11-01 18:20             ` [PATCH, 2/2] Handle recursive restrict in function parameter Tom de Vries
2015-11-03 13:47               ` Tom de Vries
2015-11-03 13:59                 ` [gomp4,committed] " Tom de Vries
2015-11-04 17:01                   ` Tom de Vries
2015-11-03 15:08                 ` [PATCH, 2/2] " Richard Biener
2015-11-03 16:44                   ` Tom de Vries
2015-11-04  9:28                     ` Richard Biener
2015-11-04 14:25                       ` [committed] " Tom de Vries
2015-10-27 13:06         ` [PATCH, 4/6] Add handle_param parameter to create_variable_info_for_1 Tom de Vries
2015-10-27 13:12         ` [PATCH, 5/6] Handle recursive restrict pointer in create_variable_info_for_1 Tom de Vries
2015-10-27 13:17         ` [PATCH, 6/6] Handle restrict struct fields recursively Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=562F72A9.6080401@mentor.com \
    --to=tom_devries@mentor.com \
    --cc=gcc-patches@gnu.org \
    --cc=rguenther@suse.de \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).