public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix IFN_MASK_STORE handling of IFN_GOMP_SIMD_LANE
@ 2019-01-07 13:25 Richard Sandiford
  2019-01-07 14:38 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2019-01-07 13:25 UTC (permalink / raw)
  To: gcc-patches

The IFN_GOMP_SIMD_LANE handling in vectorizable_store tries to use MEM_REF
offsets to maintain pointer disambiguation info.  This patch makes sure
that we don't try to do the same optimisation for IFN_MASK_STOREs, which
have no similar offset argument.

The patch fixes libgomp.c-c++-common/pr66199-*.c for SVE.  Previously
we had an ncopies==2 store and stored both halves to the same address.

Tested on aarch64-linux-gnu (with and without SVE), aarch64_be-elf
and x86_64-linux-gnu.  OK to install?

Richard


2019-01-07  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* tree-vect-stmts.c (vectorizable_store): Don't use the dataref_offset
	optimization for masked stores.

Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c	2019-01-04 11:39:27.190246648 +0000
+++ gcc/tree-vect-stmts.c	2019-01-07 13:23:28.048406652 +0000
@@ -7059,6 +7059,7 @@ vectorizable_store (stmt_vec_info stmt_i
 	  bool simd_lane_access_p
 	    = STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info);
 	  if (simd_lane_access_p
+	      && !loop_masks
 	      && TREE_CODE (DR_BASE_ADDRESS (first_dr_info->dr)) == ADDR_EXPR
 	      && VAR_P (TREE_OPERAND (DR_BASE_ADDRESS (first_dr_info->dr), 0))
 	      && integer_zerop (DR_OFFSET (first_dr_info->dr))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix IFN_MASK_STORE handling of IFN_GOMP_SIMD_LANE
  2019-01-07 13:25 Fix IFN_MASK_STORE handling of IFN_GOMP_SIMD_LANE Richard Sandiford
@ 2019-01-07 14:38 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2019-01-07 14:38 UTC (permalink / raw)
  To: GCC Patches, Richard Sandiford

On Mon, Jan 7, 2019 at 2:25 PM Richard Sandiford
<richard.sandiford@arm.com> wrote:
>
> The IFN_GOMP_SIMD_LANE handling in vectorizable_store tries to use MEM_REF
> offsets to maintain pointer disambiguation info.  This patch makes sure
> that we don't try to do the same optimisation for IFN_MASK_STOREs, which
> have no similar offset argument.
>
> The patch fixes libgomp.c-c++-common/pr66199-*.c for SVE.  Previously
> we had an ncopies==2 store and stored both halves to the same address.
>
> Tested on aarch64-linux-gnu (with and without SVE), aarch64_be-elf
> and x86_64-linux-gnu.  OK to install?

OK.

Richard.

> Richard
>
>
> 2019-01-07  Richard Sandiford  <richard.sandiford@arm.com>
>
> gcc/
>         * tree-vect-stmts.c (vectorizable_store): Don't use the dataref_offset
>         optimization for masked stores.
>
> Index: gcc/tree-vect-stmts.c
> ===================================================================
> --- gcc/tree-vect-stmts.c       2019-01-04 11:39:27.190246648 +0000
> +++ gcc/tree-vect-stmts.c       2019-01-07 13:23:28.048406652 +0000
> @@ -7059,6 +7059,7 @@ vectorizable_store (stmt_vec_info stmt_i
>           bool simd_lane_access_p
>             = STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info);
>           if (simd_lane_access_p
> +             && !loop_masks
>               && TREE_CODE (DR_BASE_ADDRESS (first_dr_info->dr)) == ADDR_EXPR
>               && VAR_P (TREE_OPERAND (DR_BASE_ADDRESS (first_dr_info->dr), 0))
>               && integer_zerop (DR_OFFSET (first_dr_info->dr))

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-07 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07 13:25 Fix IFN_MASK_STORE handling of IFN_GOMP_SIMD_LANE Richard Sandiford
2019-01-07 14:38 ` Richard Biener

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).