https://gcc.gnu.org/g:78250307c37523f8814639e1cecb2117f50f546d

commit r17-4421-g78250307c37523f8814639e1cecb2117f50f546d
Author: Richard Biener <[email protected]>
Date:   Fri Sep 18 10:27:19 2026 +0200

    Assert we properly soft-fail SLP nodes during discovery
    
    With delaying soft-failing of SLP discovery we should make sure
    the SLP discovery cache never ends up with non-failed nodes that
    would need splitting.
    
            * tree-vect-slp.cc (vect_build_slp_tree): Assert successful
            discovered nodes do not require splitting.

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

diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc
index 26215d23dcf7..12b1abe3d786 100644
--- a/gcc/tree-vect-slp.cc
+++ b/gcc/tree-vect-slp.cc
@@ -2052,6 +2052,10 @@ vect_build_slp_tree (vec_info *vinfo,
       gcc_assert (res_ == res);
       /* Keep a reference for the bst_map use.  */
       SLP_TREE_REF_COUNT (res)++;
+      /* For BB vectorization nodes that need splitting should be failed.  */
+      gcc_assert (!is_a <bb_vec_info> (vinfo)
+                 || multiple_p (group_size,
+                                TYPE_VECTOR_SUBPARTS (res->vectype)));
     }
   return res_;
 }

Reply via email to