public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@redhat.com>
To: Andrew MacLeod <amacleod@redhat.com>
Cc: Richard Biener <rguenther@suse.de>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [COMMITTED] Abstract interesting ssa-names from GORI.
Date: Thu, 18 Aug 2022 09:26:00 +0200	[thread overview]
Message-ID: <CAGm3qMW_YVNZ1pBqdBra1Rif7Ga74vHP+__Kz-nDLnfeUTNt0Q@mail.gmail.com> (raw)
In-Reply-To: <020dfac2-48c1-924d-d3b6-9693e795e625@redhat.com>

Thanks.

Pushed.

On Wed, Aug 17, 2022 at 3:18 AM Andrew MacLeod <amacleod@redhat.com> wrote:
>
>
> On 8/16/22 21:16, Andrew MacLeod wrote:
> >
> > On 8/16/22 04:21, Aldy Hernandez wrote:
> >> On Thu, Aug 11, 2022 at 1:42 PM Richard Biener <rguenther@suse.de>
> >> wrote:
> >>
> >>> @@ -599,6 +592,30 @@ path_range_query::compute_imports (bitmap
> >>> imports, const vec<basic_block> &path)
> >>>                  worklist.safe_push (arg);
> >>>              }
> >>>          }
> >>> +      else if (gassign *ass = dyn_cast <gassign *> (def_stmt))
> >>> +       {
> >>> +         tree ssa[3];
> >>> +         if (range_op_handler (ass))
> >>> +           {
> >>> +             ssa[0] = gimple_range_ssa_p (gimple_range_operand1
> >>> (ass));
> >>> +             ssa[1] = gimple_range_ssa_p (gimple_range_operand2
> >>> (ass));
> >>> +             ssa[2] = NULL_TREE;
> >>> +           }
> >>> +         else if (gimple_assign_rhs_code (ass) == COND_EXPR)
> >>> +           {
> >>> +             ssa[0] = gimple_range_ssa_p (gimple_assign_rhs1 (ass));
> >>> +             ssa[1] = gimple_range_ssa_p (gimple_assign_rhs2 (ass));
> >>> +             ssa[2] = gimple_range_ssa_p (gimple_assign_rhs3 (ass));
> >>> +           }
> >>> +         else
> >>> +           continue;
> >>> +         for (unsigned j = 0; j < 3; ++j)
> >>> +           {
> >>> +             tree rhs = ssa[j];
> >>> +             if (rhs && add_to_imports (rhs, imports))
> >>> +               worklist.safe_push (rhs);
> >>> +           }
> >>> +       }
> >> We seem to have 3 copies of this copy now: this one, the
> >> threadbackward one, and the original one.
> >>
> >> Could we abstract this somehow?
> >>
> >> Aldy
> >>
> >
> > This particular code sequence processing range-ops and COND_EXPR is
> > becoming more common, so I've abstracted it into a routine.
> >
> > Basically, pass it a vector and the stmt, and it will fill the first X
> > elements with ssa-names from the stmt.  It only deals with range-ops
> > and COND_EXPR for now, and it requires you pass it enough elements (3)
> > so that it doesn't have to check if its overflowing the bounds.  It
> > returns the number of names it put in the vector.
> >
> > This patch changes GORI to use the new routine.  Bootstrapped on
> > x86_64-pc-linux-gnu with no regressions.  Pushed.
> >
> >
> > Andrew
>
>
> This patch converts the code sequence you complained about to use the
> new routine.  Check to make sure it doesnt affect the nuber of threads,
> it should bootstrap and pass regressions, but I have run out of time
> today.   Give it a go, and if there was another place you saw this,
> change it there too.  I didn't find another place.
>
> Andrew


      reply	other threads:[~2022-08-18  7:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <73820.122081107421800679@us-mta-533.us.mimecast.lan>
2022-08-11 13:11 ` [PATCH] Tame path_range_query::compute_imports Aldy Hernandez
2022-08-11 13:59 ` Andrew MacLeod
2022-08-11 15:11   ` Aldy Hernandez
2022-08-15  9:53     ` Richard Biener
2022-08-16  8:56       ` Aldy Hernandez
2022-08-16  9:28         ` Richard Biener
2022-08-16 10:25       ` Aldy Hernandez
2022-08-16 11:38         ` Richard Biener
2022-08-16 12:17           ` Aldy Hernandez
2022-08-16 12:26             ` Richard Biener
2022-08-16 12:32               ` Aldy Hernandez
2022-08-16 13:47         ` Andrew MacLeod
2022-08-16 13:55           ` Aldy Hernandez
2022-08-16  8:21 ` Aldy Hernandez
2022-08-16  8:32   ` Richard Biener
2022-08-16  9:08     ` Aldy Hernandez
2022-08-16  9:15       ` Aldy Hernandez
2022-08-16  9:28         ` Richard Biener
2022-08-16 13:42           ` Andrew MacLeod
2022-08-17  1:16   ` [COMMITTED] Abstract interesting ssa-names from GORI Andrew MacLeod
2022-08-17  1:18     ` Andrew MacLeod
2022-08-18  7:26       ` Aldy Hernandez [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=CAGm3qMW_YVNZ1pBqdBra1Rif7Ga74vHP+__Kz-nDLnfeUTNt0Q@mail.gmail.com \
    --to=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).