public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Tamar Christina <tamar.christina@arm.com>
Cc: gcc-patches@gcc.gnu.org, nd@arm.com
Subject: Re: [PATCH]middle-end Guard value_replacement and store_elim from seeing diamonds.
Date: Fri, 5 Aug 2022 13:47:01 +0000 (UTC)	[thread overview]
Message-ID: <nycvar.YFH.7.77.849.2208051346550.3343@jbgna.fhfr.qr> (raw)
In-Reply-To: <patch-16124-tamar@arm.com>

On Fri, 5 Aug 2022, Tamar Christina wrote:

> Hi All,
> 
> This excludes value_replacement and store_elim from diamonds as they don't
> handle the form properly.
> 
> Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu
> and no issues.
> 
> Ok for master?

OK

> Thanks,
> Tamar
> 
> gcc/ChangeLog:
> 
> 	PR middle-end/106534
> 	* tree-ssa-phiopt.cc (tree_ssa_phiopt_worker): Guard the
> 	value_replacement and store_elim from diamonds.
> 
> --- inline copy of patch -- 
> diff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc
> index bdbf52916b0f88ee4f475e1fa306046d61f13d53..1e002c608591836ffb001724b3f469a8d042ae5e 100644
> --- a/gcc/tree-ssa-phiopt.cc
> +++ b/gcc/tree-ssa-phiopt.cc
> @@ -283,7 +283,7 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_hoist_loads, bool early_p)
>  	  || (e1->flags & EDGE_FALLTHRU) == 0)
>          continue;
>  
> -      if (do_store_elim)
> +      if (do_store_elim && !diamond_p)
>  	{
>  	  /* Also make sure that bb1 only have one predecessor and that it
>  	     is bb.  */
> @@ -310,7 +310,7 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_hoist_loads, bool early_p)
>  
>  	  /* Value replacement can work with more than one PHI
>  	     so try that first. */
> -	  if (!early_p)
> +	  if (!early_p && !diamond_p)
>  	    for (gsi = gsi_start (phis); !gsi_end_p (gsi); gsi_next (&gsi))
>  	      {
>  		phi = as_a <gphi *> (gsi_stmt (gsi));
> 
> 
> 
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg,
Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman;
HRB 36809 (AG Nuernberg)

  reply	other threads:[~2022-08-05 13:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05 13:15 Tamar Christina
2022-08-05 13:47 ` Richard Biener [this message]
2023-03-30 22:58 ` Andrew Pinski

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=nycvar.YFH.7.77.849.2208051346550.3343@jbgna.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.com \
    --cc=tamar.christina@arm.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).