public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Richard Sandiford <richard.sandiford@arm.com>
Cc: juzhe.zhong@rivai.ai, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] VECT: Add decrement IV iteration loop control by variable amount support
Date: Wed, 26 Apr 2023 07:43:29 +0000 (UTC)	[thread overview]
Message-ID: <nycvar.YFH.7.77.849.2304260740510.4466@jbgna.fhfr.qr> (raw)
In-Reply-To: <mptbkjb3nml.fsf@arm.com>

On Tue, 25 Apr 2023, Richard Sandiford wrote:

> juzhe.zhong@rivai.ai writes:
> > diff --git a/gcc/tree-ssa-loop-manip.cc b/gcc/tree-ssa-loop-manip.cc
> > index a52277abdbf..54845a62298 100644
> > --- a/gcc/tree-ssa-loop-manip.cc
> > +++ b/gcc/tree-ssa-loop-manip.cc
> > @@ -59,14 +59,14 @@ static bitmap_obstack loop_renamer_obstack;
> >  void
> >  create_iv (tree base, tree step, tree var, class loop *loop,
> >  	   gimple_stmt_iterator *incr_pos, bool after,
> > -	   tree *var_before, tree *var_after)
> > +	   tree *var_before, tree *var_after, enum tree_code code)
> 
> The comment needs to be updated to describe the new interface.
> 
> This is personal preference, but: I think the interface would be
> clearer if the code argument came between the base and step,
> so that the order matches a SCEV.  The code could no longer be
> a default argument, and so all callers would need to be updated,
> but IMO that's OK.  Not sure what others think though.

Just a quick comment - I think decrementing IVs are already supported,
you just have to make 'step' negative (or large positive).  If you
really think using MINUS_EXPR is better or even required for
VLA step please add an assert that 'code' is either PLUS_EXPR or
MINUS_EXPR.

Note that for INTEGER_CST step we rewrite x - CST to x + -CST
during folding.

Going over v3 now.

Richard.

  parent reply	other threads:[~2023-04-26  7:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-25 13:42 juzhe.zhong
2023-04-25 16:58 ` Richard Sandiford
2023-04-25 18:30   ` Bernhard Reutner-Fischer
2023-04-26  4:15   ` juzhe.zhong
2023-04-26  8:06     ` Richard Sandiford
2023-04-26  8:55       ` juzhe.zhong
2023-04-26  9:06         ` Richard Sandiford
2023-04-26 10:03           ` juzhe.zhong
2023-04-26 11:49             ` Richard Sandiford
     [not found]       ` <20230426165504066654201@rivai.ai>
2023-04-26  9:05         ` juzhe.zhong
2023-04-26  7:43   ` Richard Biener [this message]
2023-04-26  7:46     ` Richard Sandiford

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.2304260740510.4466@jbgna.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=richard.sandiford@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).