[X86][AVX] Prefer VPBLENDW+VPBLENDD to VPBLENDVB for v16i16 blend shuffles
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 29 Aug 2018 10:51:08 +0000 (10:51 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 29 Aug 2018 10:51:08 +0000 (10:51 +0000)
commit6b9bf7ecbc152d5941712f967cd93d1c0e2042a7
treef186aae5f625f35467587cd64022ec269a8b3ad1
parentedc318166fc9b2882fdab0d004bc3bdb598197d6
[X86][AVX] Prefer VPBLENDW+VPBLENDD to VPBLENDVB for v16i16 blend shuffles

Noticed while looking at D49562 codegen - we can avoid a large constant mask load and a slow VPBLENDVB select op by using VPBLENDW+VPBLENDD instead.

TODO: As discussed on the patch, we should investigate adding VPBLENDVB handling to target shuffle combining as well, that will allow us to extend this to VPBLENDW+VPBLENDW+VPBLENDD.

Differential Revision: https://reviews.llvm.org/D50074

llvm-svn: 340913
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/insertelement-ones.ll
llvm/test/CodeGen/X86/vector-shuffle-256-v16.ll
llvm/test/CodeGen/X86/vector-shuffle-256-v32.ll
llvm/test/CodeGen/X86/vector-shuffle-512-v32.ll
llvm/test/CodeGen/X86/vector-shuffle-v48.ll