public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] vect: Fix SVE mask_gather_load/store_store tests
@ 2021-11-12 17:55 Richard Sandiford
  2021-11-12 19:04 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Sandiford @ 2021-11-12 17:55 UTC (permalink / raw)
  To: gcc-patches

If-conversion now applies rewrite_to_defined_overflow to the
address calculation in an IFN_MASK_LOAD.  This means that we
end up with:

    cast_base = (uintptr_t) base;
    uncast_sum = cast_base + offset;
    sum = (orig_type *) uncast_sum;

If the target supports IFN_MASK_GATHER_LOAD with pointer-sized
offsets for the given vectype, we wouldn't look through the sum
cast and so would needlessly vectorise the uncast_sum addition.

This showed up as several failures in gcc.target/aarch64/sve.

Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Richard


gcc/
	* tree-vect-data-refs.c (vect_check_gather_scatter): Continue
	processing conversions if the current offset is a pointer.
---
 gcc/tree-vect-data-refs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
index f1d7f01a9ce..888ad72f3a9 100644
--- a/gcc/tree-vect-data-refs.c
+++ b/gcc/tree-vect-data-refs.c
@@ -4139,6 +4139,7 @@ vect_check_gather_scatter (stmt_vec_info stmt_info, loop_vec_info loop_vinfo,
 	  /* Don't include the conversion if the target is happy with
 	     the current offset type.  */
 	  if (use_ifn_p
+	      && !POINTER_TYPE_P (TREE_TYPE (off))
 	      && vect_gather_scatter_fn_p (loop_vinfo, DR_IS_READ (dr),
 					   masked_p, vectype, memory_type,
 					   TREE_TYPE (off), scale, &ifn,
-- 
2.25.1


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

* Re: [PATCH] vect: Fix SVE mask_gather_load/store_store tests
  2021-11-12 17:55 [PATCH] vect: Fix SVE mask_gather_load/store_store tests Richard Sandiford
@ 2021-11-12 19:04 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-11-12 19:04 UTC (permalink / raw)
  To: Richard Sandiford, Richard Sandiford via Gcc-patches, gcc-patches

On November 12, 2021 6:55:47 PM GMT+01:00, Richard Sandiford via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>If-conversion now applies rewrite_to_defined_overflow to the
>address calculation in an IFN_MASK_LOAD.  This means that we
>end up with:
>
>    cast_base = (uintptr_t) base;
>    uncast_sum = cast_base + offset;
>    sum = (orig_type *) uncast_sum;
>
>If the target supports IFN_MASK_GATHER_LOAD with pointer-sized
>offsets for the given vectype, we wouldn't look through the sum
>cast and so would needlessly vectorise the uncast_sum addition.
>
>This showed up as several failures in gcc.target/aarch64/sve.
>
>Regstrapped on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Ok. 

Richard. 

>Richard
>
>
>gcc/
>	* tree-vect-data-refs.c (vect_check_gather_scatter): Continue
>	processing conversions if the current offset is a pointer.
>---
> gcc/tree-vect-data-refs.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c
>index f1d7f01a9ce..888ad72f3a9 100644
>--- a/gcc/tree-vect-data-refs.c
>+++ b/gcc/tree-vect-data-refs.c
>@@ -4139,6 +4139,7 @@ vect_check_gather_scatter (stmt_vec_info stmt_info, loop_vec_info loop_vinfo,
> 	  /* Don't include the conversion if the target is happy with
> 	     the current offset type.  */
> 	  if (use_ifn_p
>+	      && !POINTER_TYPE_P (TREE_TYPE (off))
> 	      && vect_gather_scatter_fn_p (loop_vinfo, DR_IS_READ (dr),
> 					   masked_p, vectype, memory_type,
> 					   TREE_TYPE (off), scale, &ifn,


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

end of thread, other threads:[~2021-11-12 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12 17:55 [PATCH] vect: Fix SVE mask_gather_load/store_store tests Richard Sandiford
2021-11-12 19:04 ` 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).