We may not classify a BB vectorization load as VMAT_ELEMENTWISE as
that will ICE.  Instead we build vectors from existing scalar loads.
Make that explicit.

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

        * tree-vect-stmts.cc (get_load_store_type): Explicitly fail
        when we end up with VMAT_ELEMENTWISE for BB vectorization.
---
 gcc/tree-vect-stmts.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc
index bdedb25efe9..cfc4f323a22 100644
--- a/gcc/tree-vect-stmts.cc
+++ b/gcc/tree-vect-stmts.cc
@@ -2492,6 +2492,11 @@ get_load_store_type (vec_info  *vinfo, stmt_vec_info 
stmt_info,
                         "not falling back to elementwise accesses\n");
       return false;
     }
+
+  /* For BB vectorization build up the vector from existing scalar defs.  */
+  if (!loop_vinfo && *memory_access_type == VMAT_ELEMENTWISE)
+    return false;
+
   return true;
 }
 
-- 
2.51.0

Reply via email to