From 412c156d78c764d4aec3e94469ba5a4c068cee4c Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Thu, 12 Sep 2024 11:31:59 +0200 Subject: Abort loop SLP analysis quicker As we can't cope with removed SLP instances during analysis there's no point in doing that or even continuing analysis of SLP instances after a failure. The following makes us abort early. * tree-vect-slp.cc (vect_slp_analyze_operations): When doing loop analysis fail after the first failed SLP instance. Only remove instances when doing BB vectorization. * tree-vect-loop.cc (vect_analyze_loop_2): Check whether vect_slp_analyze_operations failed instead of checking the number of SLP instances remaining. --- gcc/tree-vect-loop.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'gcc/tree-vect-loop.cc') diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc index 65d7ed5..cc15492 100644 --- a/gcc/tree-vect-loop.cc +++ b/gcc/tree-vect-loop.cc @@ -2947,12 +2947,10 @@ start_over: if (slp) { - /* Analyze operations in the SLP instances. Note this may - remove unsupported SLP instances which makes the above - SLP kind detection invalid. */ - unsigned old_size = LOOP_VINFO_SLP_INSTANCES (loop_vinfo).length (); - vect_slp_analyze_operations (loop_vinfo); - if (LOOP_VINFO_SLP_INSTANCES (loop_vinfo).length () != old_size) + /* Analyze operations in the SLP instances. We can't simply + remove unsupported SLP instances as this makes the above + SLP kind detection invalid and might also affect the VF. */ + if (! vect_slp_analyze_operations (loop_vinfo)) { ok = opt_result::failure_at (vect_location, "unsupported SLP instances\n"); -- cgit v1.1