public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Sudakshina Das <Sudi.Das@arm.com>,
	"gcc-patches@gcc.gnu.org"	 <gcc-patches@gcc.gnu.org>
Cc: Richard Sandiford <Richard.Sandiford@arm.com>,
	Richard Biener	 <richard.guenther@gmail.com>
Subject: Re: Fwd: [PATCH, GCC, Vect] Fix costing for vector shifts
Date: Sat, 07 Dec 2019 17:44:00 -0000	[thread overview]
Message-ID: <cfda82d50c9700d384a234c92cbcacfb023b90d1.camel@redhat.com> (raw)
In-Reply-To: <e6689a2a-e889-1aa2-eabf-43ccc3d0af52@arm.com>

On Fri, 2019-12-06 at 14:05 +0000, Sudakshina Das wrote:
> Hi
> 
> While looking at the vectorization for following example, we
> realized 
> that even though vectorizable_shift function was distinguishing
> vector 
> shifted by vector from vector shifted by scalar, while modeling the
> cost 
> it would always add the cost of building a vector constant despite
> not 
> needing it for vector shifted by scalar.
> 
> This patch fixes this by using scalar_shift_arg to determine whether
> we 
> need to build a vector for the second operand or not. This reduces 
> prologue cost as shown in the test.
> 
> Build and regression tests pass on aarch64-none-elf and 
> x86_64-pc-linux-gnu-gcc. This gives a 3.42% boost to 525.x264_r in 
> Spec2017 for AArch64.
> 
> gcc/ChangeLog:
> 
> 2019-xx-xx  Sudakshina Das  <sudi.das@arm.com>
> 	    Richard Sandiford  <richard.sandiford@arm.com>
> 
> 	* tree-vect-stmt.c (vectorizable_shift): Condition ndts for
> 	vect_model_simple_cost call on scalar_shift_arg.
> 
> gcc/testsuite/ChangeLog:
> 
> 2019-xx-xx  Sudakshina Das  <sudi.das@arm.com>
> 
> 	* gcc.dg/vect/vect-shift-5.c: New test.
It's a bit borderline, but it's really just twiddling a cost, so OK.

jeff

  reply	other threads:[~2019-12-07 17:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bd1be471-af66-45dc-e05f-7bd04966f0e7@arm.com>
2019-12-06 14:05 ` Sudakshina Das
2019-12-07 17:44   ` Jeff Law [this message]
2019-12-09 10:23     ` Sudakshina Das
2019-12-10  9:01       ` Christophe Lyon
2019-12-10 10:43         ` Sudakshina Das

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=cfda82d50c9700d384a234c92cbcacfb023b90d1.camel@redhat.com \
    --to=law@redhat.com \
    --cc=Richard.Sandiford@arm.com \
    --cc=Sudi.Das@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@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).