https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99746
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- Btw, the following also works as a fix but obviously I'm not in a position to fully evaluate this. That said, hybrid SLP detection was rewritten during SLP pattern development so the requirement to hook things up as regular pattern might no longer be there. Tamar - can you fully test this on aarch64? I see the testcase from this PR being hybrid vectorized appropriately then. diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c index 85f2d03754d..cdd61e9a5cf 100644 --- a/gcc/tree-vect-slp-patterns.c +++ b/gcc/tree-vect-slp-patterns.c @@ -571,14 +571,8 @@ complex_pattern::build (vec_info *vinfo) STMT_VINFO_RELEVANT (call_stmt_info) = vect_used_in_scope; STMT_SLP_TYPE (call_stmt_info) = pure_slp; - /* add_pattern_stmt can't be done in vect_mark_pattern_stmts because - the non-SLP pattern matchers already have added the statement to VINFO - by the time it is called. Some of them need to modify the returned - stmt_info. vect_mark_pattern_stmts is called by recog_pattern and it - would increase the size of each pattern with boilerplate code to make - the call there. */ - vect_mark_pattern_stmts (vinfo, stmt_info, call_stmt, - SLP_TREE_VECTYPE (node)); + gimple_set_bb (call_stmt, gimple_bb (stmt_info->stmt)); + STMT_VINFO_VECTYPE (call_stmt_info) = SLP_TREE_VECTYPE (node); STMT_VINFO_SLP_VECT_ONLY_PATTERN (call_stmt_info) = true; /* Since we are replacing all the statements in the group with the same