public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@linaro.org>
To: Bin Cheng <Bin.Cheng@arm.com>
Cc: "gcc-patches\@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,  nd <nd@arm.com>
Subject: Re: [PATCH GCC8][32/33]Save niter check for vect peeling if loop versioning is required
Date: Sat, 10 Jun 2017 10:06:00 -0000	[thread overview]
Message-ID: <87a85gtawe.fsf@linaro.org> (raw)
In-Reply-To: <VI1PR0802MB21767511F259C08E5E23F7A2E7190@VI1PR0802MB2176.eurprd08.prod.outlook.com>	(Bin Cheng's message of "Tue, 18 Apr 2017 10:54:26 +0000")

Another one sorry, but:

Bin Cheng <Bin.Cheng@arm.com> writes:
> diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c
> index af874e7..98caa5e 100644
> --- a/gcc/tree-vect-loop.c
> +++ b/gcc/tree-vect-loop.c
> @@ -2214,6 +2214,36 @@ start_over:
>          }
>      }
>  
> +  /* During peeling, we need to check if number of loop iterations is
> +     enough for both peeled prolog loop and vector loop.  This check
> +     can be merged along with threshold check of loop versioning, so
> +     increase threshold for this case if necessary.  */
> +  if (LOOP_REQUIRES_VERSIONING (loop_vinfo)
> +      && (LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo)
> +	  || LOOP_VINFO_PEELING_FOR_NITER (loop_vinfo)))
> +    {
> +      unsigned niters_th;
> +
> +      /* Niters for peeled prolog loop.  */
> +      if (LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo) < 0)
> +	{
> +	  struct data_reference *dr = LOOP_VINFO_UNALIGNED_DR (loop_vinfo);
> +	  tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (DR_STMT (dr)));
> +
> +	  niters_th = TYPE_VECTOR_SUBPARTS (vectype) - 1;
> +	}
> +      else
> +	niters_th = LOOP_VINFO_PEELING_FOR_ALIGNMENT (loop_vinfo);
> +
> +      /* Niters for at least one iteration of vectorized loop.  */
> +      niters_th += LOOP_VINFO_VECT_FACTOR (loop_vinfo);
> +      /* One additional iteration because of peeling for gap.  */
> +      if (!LOOP_VINFO_PEELING_FOR_GAPS (loop_vinfo))
> +	niters_th++;

is the ! intentional here?  It looks like it should adding 1 when
peeling for gaps _is_ needed.

> +      if (LOOP_VINFO_COST_MODEL_THRESHOLD (loop_vinfo) < niters_th)
> +	LOOP_VINFO_COST_MODEL_THRESHOLD (loop_vinfo) = niters_th;
> +    }
> +
>    gcc_assert (vectorization_factor
>  	      == (unsigned)LOOP_VINFO_VECT_FACTOR (loop_vinfo));

  parent reply	other threads:[~2017-06-10 10:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 10:54 Bin Cheng
2017-05-11 11:08 ` Richard Biener
2017-06-07 11:04   ` Bin.Cheng
2017-06-10 10:06 ` Richard Sandiford [this message]
2017-06-12  8:03   ` Bin.Cheng

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=87a85gtawe.fsf@linaro.org \
    --to=richard.sandiford@linaro.org \
    --cc=Bin.Cheng@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@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).