https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116083
--- Comment #9 from GCC 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:b30424f43522171e8ffe587e0df0ce3627c88f6c commit r16-187-gb30424f43522171e8ffe587e0df0ce3627c88f6c Author: Richard Biener <rguent...@suse.de> Date: Tue Dec 3 14:21:47 2024 +0100 middle-end/116083 - vectorizer slowness Turns out SLP discovery can end up doing a lot of vector type builds from scalar types. Those are all ultimatively cached but end up built and layouted first. The latter is particularly expensive because it does tree node arithmetic to compute TYPE_SIZE and TYPE_SIZE_UNIT. The following replaces this with the appropriate poly-int arithmetic which speeds up the testcase by 50%. PR middle-end/116083 * stor-layout.cc (layout_type): Compute TYPE_SIZE and TYPE_SIZE_UNIT for vector types from the component mode sizes.