public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "Kewen.Lin" <linkw@linux.ibm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Bill Schmidt <wschmidt@linux.ibm.com>,
	 Segher Boessenkool <segher@kernel.crashing.org>,
	Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [PATCH] vect: Support vector with length cost modeling
Date: Tue, 21 Jul 2020 09:57:50 +0200	[thread overview]
Message-ID: <CAFiYyc07vGM7RBYmxWGwEpZuBA0vfvBMPeb+RQPMnXr+E55edw@mail.gmail.com> (raw)
In-Reply-To: <419f1fad-05be-115c-1a53-cb710ae7b2dc@linux.ibm.com>

On Tue, Jul 21, 2020 at 7:52 AM Kewen.Lin <linkw@linux.ibm.com> wrote:
>
> Hi,
>
> This patch is to add the cost modeling for vector with length,
> it mainly follows what we generate for vector with length in
> functions vect_set_loop_controls_directly and vect_gen_len
> at the worst case.
>
> For Power, the length is expected to be in bits 0-7 (high bits),
> we have to model the cost of shifting bits.  To allow other targets
> not suffer this, I used one target hook to describe this extra cost,
> I'm not sure if it's a correct way.
>
> Bootstrapped/regtested on powerpc64le-linux-gnu (P9) with explicit
> param vect-partial-vector-usage=1.
>
> Any comments/suggestions are highly appreciated!

I don't like the introduction of an extra target hook for this.  All
vectorizer cost modeling should ideally go through
init_cost/add_stmt_cost/finish_cost.  If the extra costing is
not per stmt then either init_cost or finish_cost is appropriate.
Currently init_cost only gets a struct loop while we should
probably give it a vec_info * parameter so targets can
check LOOP_VINFO_USING_PARTIAL_VECTORS_P and friends.

Richard.

> BR,
> Kewen
> -----
> gcc/ChangeLog:
>
>         * config/rs6000/rs6000.c (TARGET_VECTORIZE_EXTRA_LENGTH_COST): New
>         macro.
>         * doc/tm.texi: Regenerate.
>         * doc/tm.texi.in (TARGET_VECTORIZE_EXTRA_LENGTH_COST): New target hook.
>         * target.def (extra_length_cost): Likewise.
>         * tree-vect-loop.c (vect_estimate_min_profitable_iters): Add cost
>         modeling for vector with length.

  reply	other threads:[~2020-07-21  7:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  5:51 Kewen.Lin
2020-07-21  7:57 ` Richard Biener [this message]
2020-07-22  1:26   ` [PATCH v2] vect/rs6000: " Kewen.Lin
2020-07-22  6:38     ` Richard Biener
2020-07-22  7:08       ` Kewen.Lin
2020-07-22  9:11     ` Richard Sandiford
2020-07-22 15:48       ` [PATCH v3] " Kewen.Lin
2020-07-22 16:25         ` Kewen.Lin
2020-07-24 16:21           ` Richard Sandiford
2020-07-27  3:58             ` [PATCH v4] " Kewen.Lin
2020-07-27 13:40               ` Richard Sandiford
2020-07-28  8:36                 ` Kewen.Lin
2020-07-31 11:03                   ` Richard Sandiford
2020-07-31 11:20                     ` Richard Biener
2020-07-31 12:37                       ` Kewen.Lin
2020-07-31 13:01                         ` Richard Biener
2020-07-31 13:21                           ` Kewen.Lin
2020-07-31 14:51                 ` [PATCH v5] " Kewen.Lin
2020-08-05  7:27                   ` Richard Sandiford
2020-08-05 14:06                     ` Segher Boessenkool
2020-08-06  6:47                       ` Kewen.Lin
2020-07-22 17:49     ` [PATCH v2] " Segher Boessenkool
2020-07-27  3:44       ` Kewen.Lin

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=CAFiYyc07vGM7RBYmxWGwEpZuBA0vfvBMPeb+RQPMnXr+E55edw@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=richard.sandiford@arm.com \
    --cc=segher@kernel.crashing.org \
    --cc=wschmidt@linux.ibm.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).