public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/102906] [12 regression] gcc.target/arm/ivopts-4.c fails since r12-4526
Date: Wed, 10 Nov 2021 10:13:49 +0000	[thread overview]
Message-ID: <bug-102906-4-Mwj5r7FU30@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102906-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102906

--- Comment #17 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 10 Nov 2021, aldyh at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102906
> 
> --- Comment #16 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
> (In reply to rguenther@suse.de from comment #15)
> > On Wed, 10 Nov 2021, aldyh at gcc dot gnu.org wrote:
> 
> > > @@ -60,6 +63,24 @@ should_duplicate_loop_header_p (basic_block header, class
> > > loop *loop,
> > >    if (optimize_loop_for_size_p (loop)
> > >        && !loop->force_vectorize)
> > >      {
> > > +      if (gcond *last = safe_dyn_cast <gcond *> (last_stmt (header)))
> > > +       {
> > > +         gimple_ranger ranger;
> > > +         int_range<2> r;
> > > +         path_range_query path (ranger, /*resolve=*/true);
> > > +         auto_vec<basic_block> bbs (2);
> > > +         edge e = loop_preheader_edge (loop);
> > > +
> > > +         gcc_checking_assert (e->dest == header);
> > > +         bbs.quick_push (header);
> > > +         bbs.quick_push (e->src);
> > > +         bitmap imports = ranger.gori ().imports (header);
> > > +         path.compute_ranges (bbs, imports);
> > > +         path.range_of_stmt (r, last);
> > > +         r.dump ();
> > > +         fputc ('\n', stderr);
> > 
> > Nice.  Does composing the path from the exact two BBs mean that
> > it won't pick up a case like
> > 
> >   if (n > 0)
> >     if (k > 0)
> >       for (; n > 0;)
> >         ...
> > 
> > where the n > 0 outer condition is on the predecessor from
> > e->src?  Or is the path merely built to denote the fact
> > that we're interested on the entry edge of the loop only
> > (on the backedge the condition wouldn't be known)?
> 
> If the predecessor for e->src dominates it, it will also pick that up.  The
> path merely denotes the blocks we care about for intra-block ranges /
> relationals, etc.  With resolve=true (above), any range or relation not known
> within the path we will just pick up the range on entry to the path by asking
> ranger.
> 
> Does that answer your question?

Yes.  I guess it would be nice to have a CTOR or so for the case
where the path is really a single edge like in this case.

> For the record, I also agree that we should pull out these loop rotations,
> peels, etc from the threaders into the loop optimizers, as they have a better
> model to make decisions about loops.

Indeed.

  parent reply	other threads:[~2021-11-10 10:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22 23:09 [Bug middle-end/102906] New: " clyon at gcc dot gnu.org
2021-10-25  6:44 ` [Bug middle-end/102906] " rguenth at gcc dot gnu.org
2021-10-30 17:51 ` aldyh at gcc dot gnu.org
2021-11-01 20:09 ` clyon at gcc dot gnu.org
2021-11-06 18:20 ` aldyh at redhat dot com
2021-11-07 10:36 ` clyon at gcc dot gnu.org
2021-11-08  7:12 ` aldyh at gcc dot gnu.org
2021-11-08  7:52 ` clyon at gcc dot gnu.org
2021-11-08  8:19 ` [Bug testsuite/102906] " aldyh at gcc dot gnu.org
2021-11-08  8:41 ` aldyh at gcc dot gnu.org
2021-11-08 17:53 ` clyon at gcc dot gnu.org
2021-11-08 18:20 ` aldyh at gcc dot gnu.org
2021-11-09  8:15 ` [Bug tree-optimization/102906] " rguenth at gcc dot gnu.org
2021-11-10  9:15 ` aldyh at gcc dot gnu.org
2021-11-10  9:18 ` rguenther at suse dot de
2021-11-10  9:53 ` aldyh at gcc dot gnu.org
2021-11-10  9:57 ` rguenther at suse dot de
2021-11-10 10:07 ` aldyh at gcc dot gnu.org
2021-11-10 10:13 ` rguenther at suse dot de [this message]
2021-11-10 10:20 ` aldyh at redhat dot com
2021-11-10 12:59 ` aldyh at gcc dot gnu.org
2021-11-10 22:13 ` cvs-commit at gcc dot gnu.org
2021-11-11  6:19 ` aldyh at gcc dot gnu.org
2021-11-14 10:39 ` aldyh at gcc dot gnu.org

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=bug-102906-4-Mwj5r7FU30@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).