OSDN Git Service

[LegalizeVectorTypes][X86][ARM][AArch64][PowerPC] Don't use SplitVecOp_TruncateHelper...
authorCraig Topper <craig.topper@intel.com>
Mon, 26 Nov 2018 21:12:39 +0000 (21:12 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 26 Nov 2018 21:12:39 +0000 (21:12 +0000)
commit689482be8563af667f95cf8371721e13163d890b
tree4539793e20ec70b1f37a421abf331c229264cb81
parente7e4f1f171d0800bded962cc0181c6af5848d4d0
[LegalizeVectorTypes][X86][ARM][AArch64][PowerPC] Don't use SplitVecOp_TruncateHelper for FP_TO_SINT/UINT.

SplitVecOp_TruncateHelper tries to promote the result type while splitting FP_TO_SINT/UINT. It then concatenates the result and introduces a truncate to the original result type. But it does this without inserting the AssertZExt/AssertSExt that the regular result type promotion would insert. Nor does it turn FP_TO_UINT into FP_TO_SINT the way normal result type promotion for these operations does. This is bad on X86 which doesn't support FP_TO_SINT until AVX512.

This patch disables the use of SplitVecOp_TruncateHelper for these operations and just lets normal promotion handle it. I've tweaked a couple things in X86ISelLowering to avoid a few obvious regressions there. I believe all the changes on X86 are improvements. The other targets look neutral.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347593 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/AArch64/arm64-convert-v4f64.ll
test/CodeGen/AArch64/vcvt-oversize.ll
test/CodeGen/ARM/vcvt.ll
test/CodeGen/PowerPC/vec_conv_fp64_to_i16_elts.ll
test/CodeGen/PowerPC/vec_conv_fp64_to_i8_elts.ll
test/CodeGen/X86/vec_cast2.ll
test/CodeGen/X86/vec_fp_to_int-widen.ll
test/CodeGen/X86/vec_fp_to_int.ll