https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97707
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |jakub at gcc dot gnu.org Blocks| |53947 Target| |x86_64-*-* i?86-*-* Ever confirmed|0 |1 Last reconfirmed| |2020-11-04 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- -mprefer-vector-width=256 means it _prefers_ AVX256 but then in case vectorization fails (for whatever bogus reason) with AVX256 it will still try AVX512: static unsigned int ix86_autovectorize_vector_modes (vector_modes *modes, bool all) { if (TARGET_AVX512F && !TARGET_PREFER_AVX256) { modes->safe_push (V64QImode); modes->safe_push (V32QImode); modes->safe_push (V16QImode); } else if (TARGET_AVX512F && all) { modes->safe_push (V32QImode); modes->safe_push (V16QImode); modes->safe_push (V64QImode); } the odd thing is that the dumps suggest we use V4DFmode. We use a VF of 8 because of V8SI and it seems that call vectorization then chooses the larger vector mode because it is supported - it seems to have its own idea of costing there (probably reasonable). Do you think this is a bad idea? Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947 [Bug 53947] [meta-bug] vectorizer missed-optimizations