public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jan Hubicka <hubicka@kam.mff.cuni.cz>,
	Jan Hubicka via Gcc-patches <gcc-patches@gcc.gnu.org>,
	gcc-patches@gcc.gnu.org
Subject: Re: Cleanup compute_points_to_sets
Date: Tue, 19 Oct 2021 15:44:53 +0200	[thread overview]
Message-ID: <39C88532-7B3D-483A-993B-80348F179851@gmail.com> (raw)
In-Reply-To: <20211019123547.GC60635@kam.mff.cuni.cz>

On October 19, 2021 2:35:47 PM GMT+02:00, Jan Hubicka via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>Hi,
>this patch fixes two issues I noticed while proofreading the code.
>First is that I have added conditional around setting of nonlocal and
>escaped flags (since they may be set from solver) while keeping the
>variable in assignment that is confusing.
>
>Second is that we still do not set pt in the case function has no memory
>side effects.  In this case the call use is not going to be used since
>uses_global_memory is false only if either function is const or modref
>determined that all loads are from memory pointed to by parameters.  In
>both cases we will disambiguate earlier before asking PTA oracle, but it
>is better to avoid stale PTA sets (which shows in -alias dumps etc.)
>
>Most of builtins are not modifying global memory, one option would be to
>stick another flag into the fnspecs strings for this property.
>
>Bootstrapped/regtested x86_64-linux, OK?

Ok. 

Richard. 

>Honza
>
>gcc/ChangeLog:
>
>	* tree-ssa-structalias.c (compute_points_to_sets): Cleanup.
>
>diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
>index 2e6513bb72a..35971a54e02 100644
>--- a/gcc/tree-ssa-structalias.c
>+++ b/gcc/tree-ssa-structalias.c
>@@ -7550,8 +7550,8 @@ compute_points_to_sets (void)
> 		     always escaped.  */
> 		  if (uses_global_memory)
> 		    {
>-		      pt->nonlocal = uses_global_memory;
>-		      pt->escaped = uses_global_memory;
>+		      pt->nonlocal = 1;
>+		      pt->escaped = 1;
> 		    }
> 		}
> 	      else if (uses_global_memory)
>@@ -7561,6 +7561,8 @@ compute_points_to_sets (void)
> 		  *pt = cfun->gimple_df->escaped;
> 		  pt->nonlocal = 1;
> 		}
>+	      else
>+		memset (pt, 0, sizeof (struct pt_solution));
> 	    }
> 
> 	  pt = gimple_call_clobber_set (stmt);
>@@ -7582,8 +7584,8 @@ compute_points_to_sets (void)
> 		     always escaped.  */
> 		  if (writes_global_memory)
> 		    {
>-		      pt->nonlocal = writes_global_memory;
>-		      pt->escaped = writes_global_memory;
>+		      pt->nonlocal = 1;
>+		      pt->escaped = 1;
> 		    }
> 		}
> 	      else if (writes_global_memory)
>@@ -7593,6 +7595,8 @@ compute_points_to_sets (void)
> 		  *pt = cfun->gimple_df->escaped;
> 		  pt->nonlocal = 1;
> 		}
>+	      else
>+		memset (pt, 0, sizeof (struct pt_solution));
> 	    }
> 	}
>     }


      reply	other threads:[~2021-10-19 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 12:35 Jan Hubicka
2021-10-19 13:44 ` Richard Biener [this message]

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=39C88532-7B3D-483A-993B-80348F179851@gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@kam.mff.cuni.cz \
    /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).