public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	Andrew Pinski <apinski@marvell.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 4/4] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement
Date: Wed, 20 Oct 2021 12:57:11 -0700	[thread overview]
Message-ID: <CA+=Sn1n6EA1xgVJMFtpJ09=TWhq5NHpYWNJx5Oqwm16cTQk0Nw@mail.gmail.com> (raw)
In-Reply-To: <bbf9f4f9-aa61-9d89-c997-914a99db22ab@gmail.com>

On Wed, Oct 20, 2021 at 12:54 PM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> On 10/20/2021 12:58 AM, Richard Biener wrote:
> > On Wed, Oct 20, 2021 at 1:14 AM Jeff Law via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> >>
> >>
> >> On 10/18/2021 10:54 PM, apinski--- via Gcc-patches wrote:
> >>> From: Andrew Pinski <apinski@marvell.com>
> >>>
> >>> Instead of putting a full blow DCE after execute_fixup_cfg, it makes sense
> >>> to try to remove the defining statement for the store that is being removed.
> >>> Right now we only handle PHI node statements as there needs no extra checks
> >>> except for it is only used once in the store statement.
> >>>
> >>> gcc/ChangeLog:
> >>>
> >>>        * tree-cfg.c (maybe_remove_writeonly_store): Remove defining
> >>>        (PHI) statement of the store if possible.
> >> This is the only part that I consider at all controversial.
> >>
> >> Is the case you're trying to handle such that you have to eliminate the
> >> PHI immediately and can't wait until the next DCE pass?
> >>
> >> If so and we want to go this direction, should we pull this out into a
> >> little routine?   I'm a bit surprised we don't already have one or more
> >> that do basically the same thing.
> > We have simple_dce_from_worklist for this which you'd seed with
> > the SSA rhs of the removed stores.
> Yea, that seems like a better routine to use.  Andrew, can you try that?

Yes that is a better routine to use, the patch is in testing right
now.  I should be able to submit it in a few hours.

Thanks,
Andrew

> Jeff

      reply	other threads:[~2021-10-20 19:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19  4:54 [PATCH 0/4] Fix PR tree-opt/102703 apinski
2021-10-19  4:54 ` [PATCH 1/4] Add dump prints when execute_fixup_cfg removes a write only var store apinski
2021-10-19 23:10   ` Jeff Law
2021-10-19  4:54 ` [PATCH 2/4] Remove outdated comment about execute_fixup_cfg apinski
2021-10-19 23:10   ` Jeff Law
2021-10-19  4:54 ` [PATCH 3/4] Factor out removal of write only stores from execute_fixup_cfg apinski
2021-10-19 23:11   ` Jeff Law
2021-10-19  4:54 ` [PATCH 4/4] Improve maybe_remove_writeonly_store to do a simple DCE for defining statement apinski
2021-10-19 23:13   ` Jeff Law
2021-10-20  6:58     ` Richard Biener
2021-10-20 19:53       ` Jeff Law
2021-10-20 19:57         ` Andrew Pinski [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='CA+=Sn1n6EA1xgVJMFtpJ09=TWhq5NHpYWNJx5Oqwm16cTQk0Nw@mail.gmail.com' \
    --to=pinskia@gmail.com \
    --cc=apinski@marvell.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --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).