public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Relax COND_EXPR reduction vectorization SLP restriction
@ 2024-06-05  6:22 Richard Biener
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Biener @ 2024-06-05  6:22 UTC (permalink / raw)
  To: gcc-patches

Allow one-lane SLP but for the case where we need to swap the arms.

	* tree-vect-stmts.cc (vectorizable_condition): Allow
	single-lane SLP, but not when we need to swap then and
	else clause.
---
 gcc/tree-vect-stmts.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index b26cc74f417..c82381e799e 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -12116,7 +12116,7 @@ vectorizable_condition (vec_info *vinfo,
     = STMT_VINFO_REDUC_DEF (vect_orig_stmt (stmt_info)) != NULL;
   if (for_reduction)
     {
-      if (slp_node)
+      if (slp_node && SLP_TREE_LANES (slp_node) > 1)
 	return false;
       reduc_info = info_for_reduction (vinfo, stmt_info);
       reduction_type = STMT_VINFO_REDUC_TYPE (reduc_info);
@@ -12205,6 +12205,10 @@ vectorizable_condition (vec_info *vinfo,
 	      cond_expr = NULL_TREE;
 	    }
 	}
+      /* ???  The vectorized operand query below doesn't allow swapping
+	 this way for SLP.  */
+      if (slp_node)
+	return false;
       std::swap (then_clause, else_clause);
     }
 
-- 
2.35.3


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

* Re: [PATCH 1/4] Relax COND_EXPR reduction vectorization SLP restriction
  2024-06-07  7:51   ` Richard Biener
@ 2024-06-07  8:59     ` Kugan Vivekanandarajah
  0 siblings, 0 replies; 4+ messages in thread
From: Kugan Vivekanandarajah @ 2024-06-07  8:59 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Thanks Richard.
Created https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115383

Thanks,
Kugan

On Fri, Jun 7, 2024 at 5:51 PM Richard Biener <rguenther@suse.de> wrote:
>
> On Fri, 7 Jun 2024, Kugan Vivekanandarajah wrote:
>
> > Hi Richard,
> >
> > This seems to have introduced a regression. I am seeing ICE while
> > building TSVC_2 for AARCH64
> > with -O3 -flto -mcpu=neoverse-v2 -msve-vector-bits=128
> >
> > tsvc.c: In function 's331':
> > tsvc.c:2744:8: internal compiler error: Segmentation fault
> >  2744 | real_t s331(struct args_t * func_args)
> >       |        ^
> > 0xdfc23b crash_signal
> >         /var/jenkins/workspace/GCC_Nightly/gcc/toplev.cc:319
> > 0xa3a6f8 phi_nodes_ptr(basic_block_def*)
> >         /var/jenkins/workspace/GCC_Nightly/gcc/gimple.h:4701
> > 0xa3a6f8 gsi_start_phis(basic_block_def*)
> >         /var/jenkins/workspace/GCC_Nightly/gcc/gimple-iterator.cc:937
> > 0xa3a6f8 gsi_for_stmt(gimple*)
> >         /var/jenkins/workspace/GCC_Nightly/gcc/gimple-iterator.cc:621
> > 0x1e5f22f vectorizable_condition
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-stmts.cc:12577
> > 0x1e7a027 vect_transform_stmt(vec_info*, _stmt_vec_info*,
> > gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-stmts.cc:13467
> > 0x1112653 vect_schedule_slp_node
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:9729
> > 0x1127757 vect_schedule_slp_node
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:9522
> > 0x1127757 vect_schedule_scc
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:10017
> > 0x11285ff vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap,
> > vl_ptr> const&)
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:10110
> > 0x10f56b7 vect_transform_loop(_loop_vec_info*, gimple*)
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-loop.cc:12114
> > 0x1138c7f vect_transform_loops
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1007
> > 0x1139307 try_vectorize_loop_1
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1153
> > 0x1139307 try_vectorize_loop
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1183
> > 0x113967b execute
> >         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1299
> > Please submit a full bug report, with preprocessed source (by using
> > -freport-bug).
> >
> > Please let me know if you need a reduced testcase.
>
> Please open a bugzilla with a reduced testcase.
>
> Thanks,
> Richard.
>
> --
> Richard Biener <rguenther@suse.de>
> SUSE Software Solutions Germany GmbH,
> Frankenstrasse 146, 90461 Nuernberg, Germany;
> GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

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

* Re: [PATCH 1/4] Relax COND_EXPR reduction vectorization SLP restriction
  2024-06-07  7:40 ` Kugan Vivekanandarajah
@ 2024-06-07  7:51   ` Richard Biener
  2024-06-07  8:59     ` Kugan Vivekanandarajah
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Biener @ 2024-06-07  7:51 UTC (permalink / raw)
  To: Kugan Vivekanandarajah; +Cc: gcc-patches

On Fri, 7 Jun 2024, Kugan Vivekanandarajah wrote:

> Hi Richard,
> 
> This seems to have introduced a regression. I am seeing ICE while
> building TSVC_2 for AARCH64
> with -O3 -flto -mcpu=neoverse-v2 -msve-vector-bits=128
> 
> tsvc.c: In function 's331':
> tsvc.c:2744:8: internal compiler error: Segmentation fault
>  2744 | real_t s331(struct args_t * func_args)
>       |        ^
> 0xdfc23b crash_signal
>         /var/jenkins/workspace/GCC_Nightly/gcc/toplev.cc:319
> 0xa3a6f8 phi_nodes_ptr(basic_block_def*)
>         /var/jenkins/workspace/GCC_Nightly/gcc/gimple.h:4701
> 0xa3a6f8 gsi_start_phis(basic_block_def*)
>         /var/jenkins/workspace/GCC_Nightly/gcc/gimple-iterator.cc:937
> 0xa3a6f8 gsi_for_stmt(gimple*)
>         /var/jenkins/workspace/GCC_Nightly/gcc/gimple-iterator.cc:621
> 0x1e5f22f vectorizable_condition
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-stmts.cc:12577
> 0x1e7a027 vect_transform_stmt(vec_info*, _stmt_vec_info*,
> gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-stmts.cc:13467
> 0x1112653 vect_schedule_slp_node
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:9729
> 0x1127757 vect_schedule_slp_node
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:9522
> 0x1127757 vect_schedule_scc
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:10017
> 0x11285ff vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap,
> vl_ptr> const&)
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:10110
> 0x10f56b7 vect_transform_loop(_loop_vec_info*, gimple*)
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-loop.cc:12114
> 0x1138c7f vect_transform_loops
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1007
> 0x1139307 try_vectorize_loop_1
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1153
> 0x1139307 try_vectorize_loop
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1183
> 0x113967b execute
>         /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1299
> Please submit a full bug report, with preprocessed source (by using
> -freport-bug).
> 
> Please let me know if you need a reduced testcase.

Please open a bugzilla with a reduced testcase.

Thanks,
Richard.

-- 
Richard Biener <rguenther@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

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

* Re: [PATCH 1/4] Relax COND_EXPR reduction vectorization SLP restriction
       [not found] <20240605062311.9B64238CCBF4@sourceware.org>
@ 2024-06-07  7:40 ` Kugan Vivekanandarajah
  2024-06-07  7:51   ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Kugan Vivekanandarajah @ 2024-06-07  7:40 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

Hi Richard,

This seems to have introduced a regression. I am seeing ICE while
building TSVC_2 for AARCH64
with -O3 -flto -mcpu=neoverse-v2 -msve-vector-bits=128

tsvc.c: In function 's331':
tsvc.c:2744:8: internal compiler error: Segmentation fault
 2744 | real_t s331(struct args_t * func_args)
      |        ^
0xdfc23b crash_signal
        /var/jenkins/workspace/GCC_Nightly/gcc/toplev.cc:319
0xa3a6f8 phi_nodes_ptr(basic_block_def*)
        /var/jenkins/workspace/GCC_Nightly/gcc/gimple.h:4701
0xa3a6f8 gsi_start_phis(basic_block_def*)
        /var/jenkins/workspace/GCC_Nightly/gcc/gimple-iterator.cc:937
0xa3a6f8 gsi_for_stmt(gimple*)
        /var/jenkins/workspace/GCC_Nightly/gcc/gimple-iterator.cc:621
0x1e5f22f vectorizable_condition
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-stmts.cc:12577
0x1e7a027 vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-stmts.cc:13467
0x1112653 vect_schedule_slp_node
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:9729
0x1127757 vect_schedule_slp_node
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:9522
0x1127757 vect_schedule_scc
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:10017
0x11285ff vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap,
vl_ptr> const&)
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-slp.cc:10110
0x10f56b7 vect_transform_loop(_loop_vec_info*, gimple*)
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vect-loop.cc:12114
0x1138c7f vect_transform_loops
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1007
0x1139307 try_vectorize_loop_1
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1153
0x1139307 try_vectorize_loop
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1183
0x113967b execute
        /var/jenkins/workspace/GCC_Nightly/gcc/tree-vectorizer.cc:1299
Please submit a full bug report, with preprocessed source (by using
-freport-bug).

Please let me know if you need a reduced testcase.

Thanks,
Kugan

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

end of thread, other threads:[~2024-06-07  8:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-05  6:22 [PATCH 1/4] Relax COND_EXPR reduction vectorization SLP restriction Richard Biener
     [not found] <20240605062311.9B64238CCBF4@sourceware.org>
2024-06-07  7:40 ` Kugan Vivekanandarajah
2024-06-07  7:51   ` Richard Biener
2024-06-07  8:59     ` Kugan Vivekanandarajah

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