The following arranges the vector (de-)composition type for VMAT_STRIDED_SLP
loads and stores to be available in the ls_type field of the load/store data
for target costing.

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

        * tree-vect-stmts.cc (vectorizable_store): Record ls_type
        for VMAT_STRIDED_SLP.
        (vectorizable_load): Likewise.
---
 gcc/tree-vect-stmts.cc | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index 05b141bde1a..da87b329715 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -8533,6 +8533,13 @@ vectorizable_store (vec_info *vinfo,
                   }
            }
        }
+
+      if (costing_p)
+       /* Record the decomposition type for target access during costing.  */
+       ls.ls_type = lvectype;
+      else
+       gcc_assert (ls.ls_type == lvectype);
+
       unsigned align;
       if (alignment_support_scheme == dr_aligned)
        align = known_alignment (DR_TARGET_ALIGNMENT (first_dr_info));
@@ -10324,6 +10331,12 @@ vectorizable_load (vec_info *vinfo,
          ltype = build_aligned_type (ltype, align * BITS_PER_UNIT);
        }
 
+      if (costing_p)
+       /* Record the composition type for target access during costing.  */
+       ls.ls_type = lvectype;
+      else
+       gcc_assert (ls.ls_type == lvectype);
+
       /* For SLP permutation support we need to load the whole group,
         not only the number of vector stmts the permutation result
         fits in.  */
-- 
2.51.0

Reply via email to