public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Yuri Rumyantsev <ysrumyan@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	Igor Zamyatin <izamyatin@gmail.com>
Subject: Re: [PATCH] Simple fix to enhance outer-loop vectorization.
Date: Mon, 01 Jun 2015 10:51:00 -0000	[thread overview]
Message-ID: <CAFiYyc3ZYnv5iG_qR0Tn=qCpUe7h8ZLxK+qZz9niUhOY_Xm92w@mail.gmail.com> (raw)
In-Reply-To: <CAEoMCqQPL=ArD+dReYjWtCNW5rhTWXJdexb+1LBDXek=3NOw8w@mail.gmail.com>

On Thu, May 28, 2015 at 5:51 PM, Yuri Rumyantsev <ysrumyan@gmail.com> wrote:
> Richard,
>
> First of all, I don't think that it is possible to write out test for
> outer-loop vectorization with zero-step reference because of possible
> loop-carried dependencies and run-time aliasing is not supported for
> outer-loop. If there are no such dependencies pre or pdse does
> hoisting (sinking) of such invariant references. So I add a check on
> it to accept zero-step references for outer loop marked with
> forc-vectorize flag to guarantee absence of loop-carried dependencies
> between inner-loop iterations.
> I included run-time test that checks vectorization correctness.
>
> Update patch is attached.

Please don't use fprintf from testcases but just call abort () when
you detect an error.  gcc.dg/vect testcases shouldn't have an
explicit dg-do run, just drop it, it is implicit.

Ok with that changes.

Thanks,
Richard.



> Yuri..
>
> 2015-05-28 14:39 GMT+03:00 Richard Biener <richard.guenther@gmail.com>:
>> On Thu, May 28, 2015 at 1:00 PM, Yuri Rumyantsev <ysrumyan@gmail.com> wrote:
>>> Hi All,
>>>
>>> Here is a simple patch which removes restriction on outer-loop
>>> vectorization -  allow references in inner-loop with zero step. This
>>> case was found in one important benchmark.
>>>
>>> Bootstrap and regression testing did not show any new failures.
>>> Is it OK for trunk.
>>>
>>> ChangeLog:
>>> 2015-05-28  Yuri Rumyantsev  <ysrumyan@gmail.com>
>>>
>>> * tree-vect-data-refs.c (vect_analyze_data_ref_access): Allow
>>> consecutive accesses within outer-loop vectorization for references
>>> with zero step in inner-loop.
>>>
>>> gcc/testsuite/ChangeLog:
>>> * gcc.dg/vect/fast-math-vect-outer-1.c: New test.
>>
>> Can you please add a non-omp-simd testcase that triggers this as well and that
>> is a runtime testcase verifying the transform is correct?
>>
>> Also please don't add to the strange testcase-name machinery but just
>> use { dg-additional-options "-ffast-math" }
>>
>> Index: tree-vect-data-refs.c
>> ===================================================================
>> --- tree-vect-data-refs.c       (revision 223653)
>> +++ tree-vect-data-refs.c       (working copy)
>> @@ -2261,7 +2261,6 @@
>>    return true;
>>  }
>>
>> -
>>  /* Analyze the access pattern of the data-reference DR.
>>     In case of non-consecutive accesses call vect_analyze_group_access() to
>>     analyze groups of accesses.  */
>>
>> spurious white-space change
>>
>>
>> @@ -2291,14 +2290,8 @@
>>    if (loop_vinfo && integer_zerop (step))
>>
>> Surely the comment before this needs updating now.
>>
>>      {
>>        GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)) = NULL;
>> -      if (nested_in_vect_loop_p (loop, stmt))
>> -       {
>> -         if (dump_enabled_p ())
>> -           dump_printf_loc (MSG_NOTE, vect_location,
>> -                            "zero step in inner loop of nest\n");
>> -         return false;
>> -       }
>> -      return DR_IS_READ (dr);
>> +      if (!nested_in_vect_loop_p (loop, stmt))
>> +       return DR_IS_READ (dr);
>>      }
>>
>>    if (loop && nested_in_vect_loop_p (loop, stmt))
>>
>> so what happens after the patch?  It would be nice to have a comment
>> explaining what happens in the nested_in_vect_loop_p case for
>> the case when the outer-loop step is zero and when it is not zero.
>>
>> In particular as you don't need any code generation changes - this hints
>> at that you may miss something ;)
>>
>> Otherwise of course the patch is ok - lifting restrictions is good.
>>
>> Thanks,
>> Richard.

      reply	other threads:[~2015-06-01 10:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 11:32 Yuri Rumyantsev
2015-05-28 11:56 ` Richard Biener
2015-05-28 17:15   ` Yuri Rumyantsev
2015-06-01 10:51     ` Richard Biener [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='CAFiYyc3ZYnv5iG_qR0Tn=qCpUe7h8ZLxK+qZz9niUhOY_Xm92w@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=izamyatin@gmail.com \
    --cc=ysrumyan@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).