https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112992
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by hongtao Liu <liuho...@gcc.gnu.org>: https://gcc.gnu.org/g:be0ff0866a6f072ccfbbb3a3c2079adf1db51aa1 commit r14-6534-gbe0ff0866a6f072ccfbbb3a3c2079adf1db51aa1 Author: liuhongt <hongtao....@intel.com> Date: Wed Dec 13 11:20:46 2023 +0800 Force broadcast constant to mem for vec_dup{v4di,v8si,v4df,v8df} when TARGET_AVX2 is not available. vpbroadcastd/vpbroadcastq is avaiable under TARGET_AVX2, but vec_dup{v4di,v8si} pattern is avaiable under AVX with memory operand. And it will cause LRA/Reload to generate spill and reload if we put constant in register. gcc/ChangeLog: PR target/112992 * config/i386/i386-expand.cc (ix86_convert_const_wide_int_to_broadcast): Don't convert to broadcast for vec_dup{v4di,v8si} when TARGET_AVX2 is not available. (ix86_broadcast_from_constant): Allow broadcast for V4DI/V8SI when !TARGET_AVX2 since it will be forced to memory later. (ix86_expand_vector_move): Force constant to mem for vec_dup{vssi,v4di} when TARGET_AVX2 is not available. gcc/testsuite/ChangeLog: * gcc.target/i386/pr100865-7a.c: Adjust testcase. * gcc.target/i386/pr100865-7c.c: Ditto. * gcc.target/i386/pr112992.c: New test.