https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104912
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to CVS Commits from comment #8) > The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: > > https://gcc.gnu.org/g:ac8340ee4d1e65f3fd41c547b16895875f4aefa7 > > commit r12-8132-gac8340ee4d1e65f3fd41c547b16895875f4aefa7 > Author: Richard Biener <rguent...@suse.de> > Date: Mon Mar 21 14:08:25 2022 +0100 > > tree-optimization/104912 - ensure cost model is checked first > > The following makes sure that when we build the versioning condition > for vectorization including the cost model check, we check for the > cost model and branch over other versioning checks. That is what > the cost modeling assumes, since the cost model check is the only > one accounted for in the scalar outside cost. Currently we emit > all checks as straight-line code combined with bitwise ops which > can result in surprising ordering of checks in the final assembly. > > Since loop_version accepts only a single versioning condition > the splitting is done after the fact. > > The result is a 1.5% speedup of 416.gamess on x86_64 when compiling > with -Ofast and tuning for generic or skylake. That's not enough > to recover from the slowdown when vectorizing but it now cuts off > the expensive alias versioning test. > > 2022-03-21 Richard Biener <rguent...@suse.de> > > PR tree-optimization/104912 > * tree-vect-loop-manip.cc (vect_loop_versioning): Split > the cost model check to a separate BB to make sure it is > checked first and not combined with other version checks. I've wrongly pushed this and reverted it again.