]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Disallow scan-store vectorization in epilogues
authorRichard Biener <rguenther@suse.de>
Wed, 30 Jul 2025 13:05:19 +0000 (15:05 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 31 Jul 2025 06:35:37 +0000 (08:35 +0200)
The following disallows vectorizing epilogues containing scan-stores.
Since code generation works by walking gimple stmts it is not ready
for this when cleaning up epilogue vectorization.  I believe
scan-store vectorization needs most of the work done during SLP
discovery to reflect the data flow.

* tree-vect-stmts.cc (check_scan_store): Remove redundant
slp_node check.  Disallow epilogue vectorization.

gcc/tree-vect-stmts.cc

index 88a12a1e31892e9a416340b1a30a322c7873f1e6..47a6b6c558934af7e66be147dcd5fa5359e67b96 100644 (file)
@@ -7098,13 +7098,14 @@ check_scan_store (vec_info *vinfo, stmt_vec_info stmt_info, tree vectype,
   tree ref_type;
 
   gcc_assert (STMT_VINFO_SIMD_LANE_ACCESS_P (stmt_info) > 1);
-  if ((slp_node && SLP_TREE_LANES (slp_node) > 1)
+  if (SLP_TREE_LANES (slp_node) > 1
       || mask
       || memory_access_type != VMAT_CONTIGUOUS
       || TREE_CODE (DR_BASE_ADDRESS (dr_info->dr)) != ADDR_EXPR
       || !VAR_P (TREE_OPERAND (DR_BASE_ADDRESS (dr_info->dr), 0))
       || loop_vinfo == NULL
       || LOOP_VINFO_FULLY_MASKED_P (loop_vinfo)
+      || LOOP_VINFO_EPILOGUE_P (loop_vinfo)
       || STMT_VINFO_GROUPED_ACCESS (stmt_info)
       || !integer_zerop (get_dr_vinfo_offset (vinfo, dr_info))
       || !integer_zerop (DR_INIT (dr_info->dr))