https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102128
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:89f33f44addbf9853bc3e6677db1fa941713cb6c commit r12-3222-g89f33f44addbf9853bc3e6677db1fa941713cb6c Author: Richard Biener <rguent...@suse.de> Date: Mon Aug 30 12:56:26 2021 +0200 tree-optimization/102128 - rework if-converted BB vect heuristic This reworks the previous attempt to avoid leaving around if-converted scalar code in BB vectorized loop bodies to keep costing independent subgraphs which should address the observed regression with 519.lbm_r. For this to work we now first cost all subgraphs and only after doing that proceed to emit vectorized code. 2021-08-30 Richard Biener <rguent...@suse.de> PR tree-optimization/102128 * tree-vect-slp.c (vect_bb_vectorization_profitable_p): Move scanning for if-converted scalar code to the caller and instead delay clearing the visited flag for profitable subgraphs. (vect_slp_region): Cost all subgraphs before scheduling. For if-converted BB vectorization scan for scalar COND_EXPRs and do not vectorize if any found and the cost model is very-cheap.