https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93395
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:5d782a8d909c5cc472c911c0ab4de0b890aad868 commit r10-6215-g5d782a8d909c5cc472c911c0ab4de0b890aad868 Author: Jakub Jelinek <ja...@redhat.com> Date: Fri Jan 24 22:49:51 2020 +0100 i386: prefer vpermilpd over vpermpd [PR93395] In Agner Fog's tables, vpermilp[sd] with immediates seem to be much faster than vpermpd with immediate, for a good reason, the former only permute something within the lanes and don't do anything intra-lane, while vpermpd can. So, functionality-wise, vpermilpd is more efficient subset of vpermpd. We use the same RTL for those though (and also for certain broadcast). Now, the problem was that the vpermpd pattern appeared first in sse.md, followed by the broadcast patterns, followed by the vpermilp[sd]. Which means unless -mavx -mno-avx2, we'd emit vpermpd instead of the more efficient alternatives. The following patch reorders them, so that vpermpd comes last, if we can match a broadcast, we do, if we can match a vpermilp[sd] that is not a broadcast, we will, otherwise fall back (of course only if -mavx2) to vpermpd. 2020-01-24 Jakub Jelinek <ja...@redhat.com> PR target/93395 * config/i386/sse.md (*avx_vperm_broadcast_v4sf, *avx_vperm_broadcast_<mode>, <sse2_avx_avx512f>_vpermil<mode><mask_name>, *<sse2_avx_avx512f>_vpermilp<mode><mask_name>): Move before avx2_perm<mode>/avx512f_perm<mode>. * gcc.target/i386/pr93395.c: New test. * gcc.target/i386/avx512vl-vpermilpdi-1.c: Remove xfail.