public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-5838] tree-optimization/98180 - fix BIT_INSERT_EXPR sequence vectorization
@ 2020-12-08  8:44 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2020-12-08  8:44 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e844c04e35ca2fe9ee2f758a720dd37cbe81e7ef

commit r11-5838-ge844c04e35ca2fe9ee2f758a720dd37cbe81e7ef
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Dec 8 09:42:35 2020 +0100

    tree-optimization/98180 - fix BIT_INSERT_EXPR sequence vectorization
    
    This adds a missing check for the first inserted value.
    
    2020-12-08  Richard Biener  <rguenther@suse.de>
    
            PR tree-optimization/98180
            * tree-vect-slp.c (vect_slp_check_for_constructors): Check the
            first inserted value has a def.

Diff:
---
 gcc/tree-vect-slp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 2dccca02aa0..a2757e707ff 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -4193,10 +4193,12 @@ vect_slp_check_for_constructors (bb_vec_info bb_vinfo)
       else if (gimple_assign_rhs_code (assign) == BIT_INSERT_EXPR
 	       && VECTOR_TYPE_P (TREE_TYPE (rhs))
 	       && TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)).is_constant ()
+	       && TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)).to_constant () > 1
 	       && integer_zerop (gimple_assign_rhs3 (assign))
 	       && useless_type_conversion_p
 		    (TREE_TYPE (TREE_TYPE (rhs)),
-		     TREE_TYPE (gimple_assign_rhs2 (assign))))
+		     TREE_TYPE (gimple_assign_rhs2 (assign)))
+	       && bb_vinfo->lookup_def (gimple_assign_rhs2 (assign)))
 	{
 	  /* We start to match on insert to lane zero but since the
 	     inserts need not be ordered we'd have to search both


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

only message in thread, other threads:[~2020-12-08  8:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08  8:44 [gcc r11-5838] tree-optimization/98180 - fix BIT_INSERT_EXPR sequence vectorization 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).