This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/58497] SLP vectorizes identical operations


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58497

--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> ---
Index: gcc/tree-vect-generic.c
===================================================================
--- gcc/tree-vect-generic.c     (revision 230146)
+++ gcc/tree-vect-generic.c     (working copy)
@@ -105,6 +106,15 @@ static inline tree
 tree_vec_extract (gimple_stmt_iterator *gsi, tree type,
                  tree t, tree bitsize, tree bitpos)
 {
+  if (TREE_CODE (t) == SSA_NAME)
+    {
+      gimple *def_stmt = SSA_NAME_DEF_STMT (t);
+      if (is_gimple_assign (def_stmt)
+         && (gimple_assign_rhs_code (def_stmt) == VECTOR_CST
+             || (bitpos
+                 && gimple_assign_rhs_code (def_stmt) == CONSTRUCTOR)))
+       t = gimple_assign_rhs1 (def_stmt);
+    }
   if (bitpos)
     {
       if (TREE_CODE (type) == BOOLEAN_TYPE)

should fix it (in testing).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]