OSDN Git Service

[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)
commit02d063949d2e72e0f60d1c2ac67283bf4ca27ddc
treec3e54154b0a218a53151250712dee73e99585b20
parent301a636e639e831713481c83c878d9868dab61bb
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346936 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx512-cvt-widen.ll
test/CodeGen/X86/shuffle-vs-trunc-128-widen.ll
test/CodeGen/X86/shuffle-vs-trunc-256-widen.ll
test/CodeGen/X86/shuffle-vs-trunc-512-widen.ll
test/CodeGen/X86/vector-trunc-packus-widen.ll
test/CodeGen/X86/vector-trunc-ssat-widen.ll
test/CodeGen/X86/vector-trunc-usat-widen.ll
test/CodeGen/X86/vector-trunc-widen.ll