public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] tree-optimization/104267 - fix external def vector type for call args
@ 2022-01-28 12:29 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-01-28 12:29 UTC (permalink / raw)
  To: gcc-patches

The following fixes the vector type registered for external defs
in call arguments when vectorizing with SLP.  We assumed uniform
vectype_in types here but with calls like .COND_MUL we also have
mask arguments which, when invariant or external, need to have
a proper mask vector type.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

2022-01-28  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/104267
	* tree-vect-stmts.c (vectorizable_call): Properly use the
	per-argument determined vector type for externals and
	invariants.
---
 gcc/tree-vect-stmts.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 824ebb6354b..000a0f4b47e 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -3444,7 +3444,9 @@ vectorizable_call (vec_info *vinfo,
     {
       if (slp_node)
 	for (i = 0; i < nargs; ++i)
-	  if (!vect_maybe_update_slp_op_vectype (slp_op[i], vectype_in))
+	  if (!vect_maybe_update_slp_op_vectype (slp_op[i],
+						 vectypes[i]
+						 ? vectypes[i] : vectype_in))
 	    {
 	      if (dump_enabled_p ())
 		dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-- 
2.31.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-28 12:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-28 12:29 [PATCH] tree-optimization/104267 - fix external def vector type for call args 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).