public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Bin.Cheng" <amker.cheng@gmail.com>
To: Yuri Rumyantsev <ysrumyan@gmail.com>
Cc: Richard Biener <rguenther@suse.de>, Jeff Law <law@redhat.com>,
		gcc-patches <gcc-patches@gcc.gnu.org>,
	Ilya Enkovich <enkovich.gnu@gmail.com>
Subject: Re: [PATCH, vec-tails] Support loop epilogue vectorization
Date: Wed, 09 Nov 2016 11:46:00 -0000	[thread overview]
Message-ID: <CAHFci2_PA2umv2fB8kM5eMiSUGG=ci+2crzJwtqaVJnR-gM34Q@mail.gmail.com> (raw)
In-Reply-To: <CAEoMCqQdzimw2+kx16hDCfNmpUj7pqu_59Ce84gY0nq6ohyAvQ@mail.gmail.com>

On Wed, Nov 9, 2016 at 11:28 AM, Yuri Rumyantsev <ysrumyan@gmail.com> wrote:
> Thanks Richard for your comments.
> Your proposed to handle epilogue loop just like normal short-trip loop
> but this is not exactly truth since e.g. epilogue must not be peeled
> for alignment.
Yes there must be some differences, my motivation is to minimize that
so we don't need to specially check normal/epilogue loops at too many
places.
Of course it's just my feeling when going through the patch set, and
could be wrong.

Thanks,
bin
>
> It is not clear for me what are my next steps? Should I re-design the
> patch completely or simply decompose the whole patch to different
> parts? But it means that we must start review process from beginning
> but release is closed to its end.
> Note also that i work for Intel till the end of year and have not idea
> who will continue working on this project.
>
> Any help will be appreciated.
>
> Thanks.
> Yuri.
>
> 2016-11-09 13:37 GMT+03:00 Bin.Cheng <amker.cheng@gmail.com>:
>> On Tue, Nov 1, 2016 at 12:38 PM, Yuri Rumyantsev <ysrumyan@gmail.com> wrote:
>>> Hi All,
>>>
>>> I re-send all patches sent by Ilya earlier for review which support
>>> vectorization of loop epilogues and loops with low trip count. We
>>> assume that the only patch - vec-tails-07-combine-tail.patch - was not
>>> approved by Jeff.
>>>
>>> I did re-base of all patches and performed bootstrapping and
>>> regression testing that did not show any new failures. Also all
>>> changes related to new vect_do_peeling algorithm have been changed
>>> accordingly.
>>>
>>> Is it OK for trunk?
>>
>> Hi,
>> I can't approve patches, but had some comments after going through the
>> implementation.
>>
>> One confusing part is cost model change, as well as the way it's used
>> to decide how epilogue loop should be vectorized.  Given vect-tail is
>> disabled at the moment and the cost change needs further tuning, is it
>> reasonable to split this part out and get vectorization part
>> reviewed/submitted independently?  For example, let user specified
>> parameters make the decision for now.  Cost and target dependent
>> changes should go in at last, this could make the patch easier to
>> read.
>>
>> The implementation computes/shares quite amount information from main
>> loop to epilogue loop vectorization.  Furthermore, variables/fields
>> for such information are somehow named in a misleading way.  For
>> example. LOOP_VINFO_MASK_EPILOGUE gives me the impression this is the
>> flag controlling whether epilogue loop should be vectorized with
>> masking.  However, it's actually controlled by exactly the same flag
>> as whether epilogue loop should be combined into the main loop with
>> masking:
>> @@ -7338,6 +8013,9 @@ vect_transform_loop (loop_vec_info loop_vinfo)
>>
>>    slpeel_make_loop_iterate_ntimes (loop, niters_vector);
>>
>> +  if (LOOP_VINFO_COMBINE_EPILOGUE (loop_vinfo))
>> +    vect_combine_loop_epilogue (loop_vinfo);
>> +
>>    /* Reduce loop iterations by the vectorization factor.  */
>>    scale_loop_profile (loop, GCOV_COMPUTE_SCALE (1, vf),
>>                expected_iterations / vf);
>>
>> IMHO, we should decouple main loop vectorization and epilogue
>> vectorization as much as possible by sharing as few information as we
>> can.  The general idea is to handle epilogue loop just like normal
>> short-trip loop.  For example, we can rename
>> LOOP_VINFO_COMBINE_EPILOGUE into LOOP_VINFO_VECT_MASK (or something
>> else), and we don't differentiate its meaning between main and
>> epilogue(short-trip) loop.  It only indicates the current loop should
>> be vectorized with masking no matter it's a main loop or epilogue
>> loop, and it works just like the current implementation.
>>
>> After this change, we can refine vectorization and make it more
>> general for normal loop and epilogue(short trip) loop.  For example,
>> this implementation sets LOOP_VINFO_PEELING_FOR_NITER  for epilogue
>> loop and use it to control how it should be vectorized:
>> +  if (!LOOP_VINFO_PEELING_FOR_NITER (loop_vinfo))
>> +    {
>> +      LOOP_VINFO_MASK_EPILOGUE (loop_vinfo) = false;
>> +      LOOP_VINFO_COMBINE_EPILOGUE (loop_vinfo) = false;
>> +    }
>> +  else if (LOOP_VINFO_CAN_BE_MASKED (loop_vinfo)
>> +       && min_profitable_combine_iters >= 0)
>> +    {
>>
>> This works, but not that good for understanding or maintaining.
>>
>> Thanks,
>> bin

  reply	other threads:[~2016-11-09 11:46 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-01 12:38 Yuri Rumyantsev
2016-11-02 12:27 ` Richard Biener
2016-11-03 12:33   ` Yuri Rumyantsev
2016-11-08 12:39     ` Richard Biener
2016-11-08 14:17       ` Yuri Rumyantsev
2016-11-10 12:34         ` Richard Biener
2016-11-10 12:36           ` Richard Biener
2016-11-11 11:15             ` Yuri Rumyantsev
2016-11-11 14:15               ` Yuri Rumyantsev
2016-11-11 14:43                 ` Yuri Rumyantsev
2016-11-14 12:56                   ` Richard Biener
2016-11-14 12:51               ` Richard Biener
2016-11-14 13:30                 ` Yuri Rumyantsev
2016-11-14 13:41                   ` Richard Biener
2016-11-14 15:39                     ` Yuri Rumyantsev
2016-11-14 17:59                       ` Richard Biener
2016-11-15 14:42                         ` Yuri Rumyantsev
2016-11-16  9:56                           ` Richard Biener
2016-11-18 13:20                           ` Christophe Lyon
2016-11-18 15:46                             ` Yuri Rumyantsev
2016-11-18 15:54                               ` Christophe Lyon
2016-11-24 13:42                                 ` Yuri Rumyantsev
2016-11-28 14:39                                   ` Richard Biener
2016-11-28 16:57                                     ` Yuri Rumyantsev
2016-12-01 11:34                                       ` Richard Biener
2016-12-01 14:27                                         ` Yuri Rumyantsev
2016-12-01 14:46                                           ` Richard Biener
     [not found]                                             ` <CAEoMCqSkWgz+DJLe1M1CDxbk4LBtBU4r3rcVv7OcgpsGW4eTJA@mail.gmail.com>
     [not found]                                               ` <CAEoMCqRVVYTYWfhYrpi3TOuBe6XBw4ScVNstoqd8YShBsvRwMw@mail.gmail.com>
     [not found]                                                 ` <CAEoMCqTdOHO_OxJ-5gxDJRPQDS+9kYkKd+WdgGJz8WMuUzD61A@mail.gmail.com>
     [not found]                                                   ` <CAEoMCqQ5ZaT6TPbDL37DOZCEF5DHKWx995yn2fQZO3kV+vQ+EA@mail.gmail.com>
     [not found]                                                     ` <CAEoMCqTCaRQU-mia98uX00CtpKA9w03fhaR2hXCdywXuVAQmSw@mail.gmail.com>
     [not found]                                                       ` <CAEoMCqST8pOZmndKKuYWSyD=juPdGG1UAJ6NyAV3qkuxjV+3gA@mail.gmail.com>
     [not found]                                                         ` <alpine.LSU.2.11.1612131455080.5294@t29.fhfr.qr>
2016-12-21 10:14                                                           ` Yuri Rumyantsev
2016-12-21 17:23                                                             ` Yuri Rumyantsev
2016-11-29 16:22                                 ` Christophe Lyon
2016-11-05 18:35   ` Jeff Law
2016-11-06 11:16     ` Richard Biener
2016-11-09 10:37 ` Bin.Cheng
2016-11-09 11:28   ` Yuri Rumyantsev
2016-11-09 11:46     ` Bin.Cheng [this message]
2016-11-09 12:12       ` Yuri Rumyantsev
2016-11-09 12:40         ` Bin.Cheng
2016-11-09 12:52     ` Richard Biener

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='CAHFci2_PA2umv2fB8kM5eMiSUGG=ci+2crzJwtqaVJnR-gM34Q@mail.gmail.com' \
    --to=amker.cheng@gmail.com \
    --cc=enkovich.gnu@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.com \
    --cc=rguenther@suse.de \
    --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).