https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81723
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- Ok, so the issue is that SLP tree size limiting doesn't work effectively here with the build-from-scalars fallback as the cost of doing this is not accounted for. The tree size itself doesn't grow too much but as we analyze depth first and only after a lot of repeated work throwing away stuff for the build-from-scalars fallback this is effectively a case of exponential search.