public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "Bin.Cheng" <amker.cheng@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH GCC8][31/33]Set range information for niter bound of vectorized loop
Date: Wed, 24 May 2017 13:51:00 -0000	[thread overview]
Message-ID: <CAFiYyc1u44usDsk_yMagJY4EcqeFUAc0G3Lj=op+wDSBVaa76A@mail.gmail.com> (raw)
In-Reply-To: <CAHFci2_FCDvne58T9RfQehZw-WUHPjX+Z2ewpbB6CfYo8G1c3A@mail.gmail.com>

On Mon, May 22, 2017 at 7:13 PM, Bin.Cheng <amker.cheng@gmail.com> wrote:
> On Fri, May 19, 2017 at 1:51 PM, Richard Biener
> <richard.guenther@gmail.com> wrote:
>> On Mon, May 15, 2017 at 5:58 PM, Bin.Cheng <amker.cheng@gmail.com> wrote:
>>> On Thu, May 11, 2017 at 12:02 PM, Richard Biener
>>> <richard.guenther@gmail.com> wrote:
>>>> On Tue, Apr 18, 2017 at 12:54 PM, Bin Cheng <Bin.Cheng@arm.com> wrote
>>>>> Hi,
>>>>> Based on vect_peeling algorithm, we know for sure that vectorized loop must iterates at least once.
>>>>> This patch sets range information for niter bounds of vectorized loop.  This helps niter analysis,
>>>>> so iv elimination too.
>>>>> Is it OK?
>>>>
>>>>        niters_vector = force_gimple_operand (niters_vector, &stmts, true, var);
>>>>        gsi_insert_seq_on_edge_immediate (pe, stmts);
>>>> +      /* Peeling algorithm guarantees that vector loop bound is at least ONE,
>>>> +        we set range information to make niters analyzer's life easier.  */
>>>> +      if (TREE_CODE (niters_vector) == SSA_NAME)
>>>> +       set_range_info (niters_vector, VR_RANGE, build_int_cst (type, 1),
>>>> +                       fold_build2 (RSHIFT_EXPR, type,
>>>> +                                    TYPE_MAX_VALUE (type), log_vf));
>>>>
>>>> if all of niters_vector folds to an original SSA name then
>>>> niters_vector after gimplification
>>>> is not a new SSA name and thus you can't set range-info on it.
>>>>
>>>> Likewise for the other case where LOOP_VINFO_NITERS is just an SSA name.
>>> Hi,
>>> This is updated patch.  It checks whether the result ssa name is newly
>>> created tmp and only sets range information if so.
>>>
>>> Is it OK?
>>
>> A better way to check whether the SSA name is new is to see if 'stmts'
>> filled by force_gimple_operand is non-empty.
> Hi,
> Here is updated patch checking empty gimple_seq.  Is it OK?

Ok.  As a bonus you could have used wide-ints to feed set_range_info
(not sure if wide_int_ref & allows you to pass '1' literally...)

Richard.

> Thanks,
> bin
>>
>> Richard.
>>
>>> Thanks,
>>> bin
>>>
>>> 2017-04-11  Bin Cheng  <bin.cheng@arm.com>
>>>
>>>     * tree-vectorizer.h (vect_build_loop_niters): New parameter.
>>>     * tree-vect-loop-manip.c (vect_build_loop_niters): New parameter.
>>>     Set true to new parameter if new ssa variable is defined.
>>>     (vect_gen_vector_loop_niters): Refactor.  Set range information
>>>     for the new vector loop bound variable.
>>>     (vect_do_peeling): Ditto.
>>>
>>>>
>>>> Richard.
>>>>
>>>>> Thanks,
>>>>> bin
>>>>> 2017-04-11  Bin Cheng  <bin.cheng@arm.com>
>>>>>
>>>>>         * tree-vect-loop-manip.c (vect_gen_vector_loop_niters): Refactor.
>>>>>         Set range information for vector loop bound variable.
>>>>>         (vect_do_peeling): Ditto.

  reply	other threads:[~2017-05-24 13:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18 10:54 Bin Cheng
2017-05-11 11:06 ` Richard Biener
2017-05-15 16:10   ` Bin.Cheng
2017-05-19 12:57     ` Richard Biener
2017-05-22 17:42       ` Bin.Cheng
2017-05-24 13:51         ` Richard Biener [this message]
2017-06-07 11:09           ` 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='CAFiYyc1u44usDsk_yMagJY4EcqeFUAc0G3Lj=op+wDSBVaa76A@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=amker.cheng@gmail.com \
    --cc=gcc-patches@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).