[X86] Add some custom type legalization rules for truncate with -x86-experimental...
authorCraig Topper <craig.topper@intel.com>
Thu, 15 Nov 2018 08:23:40 +0000 (08:23 +0000)
committerCraig Topper <craig.topper@intel.com>
Thu, 15 Nov 2018 08:23:40 +0000 (08:23 +0000)
commit553ac560aa6b7c0a6df876ad06e3477b8ddafa7a
tree100963f1fb81a1c1d93a75f3e8fda8037a851b5b
parent926dbdd6016f20b374ebbe33a7019f9e265bf5f8
[X86] Add some custom type legalization rules for truncate with -x86-experimental-vector-widening-legalization.

This avoids some nasty shuffles when we have avx512. It will also prevent using zmm truncate instructions when a ymm instruction that zeroes part of an xmm register will do. Also avoid using avx512 truncate instructions when the input is 128 bits or less. These instructions are 2 uops on skx so we can probably find a better single uop shuffle like pshufb.

llvm-svn: 346936
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx512-cvt-widen.ll
llvm/test/CodeGen/X86/shuffle-vs-trunc-128-widen.ll
llvm/test/CodeGen/X86/shuffle-vs-trunc-256-widen.ll
llvm/test/CodeGen/X86/shuffle-vs-trunc-512-widen.ll
llvm/test/CodeGen/X86/vector-trunc-packus-widen.ll
llvm/test/CodeGen/X86/vector-trunc-ssat-widen.ll
llvm/test/CodeGen/X86/vector-trunc-usat-widen.ll
llvm/test/CodeGen/X86/vector-trunc-widen.ll