[PATCH] D54467: [X86] Disable combineToExtendVectorInReg under -x86-experimental-vector-widening-legalization. Add custom type legalization for extends.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 00:38:32 PST 2018


craig.topper created this revision.
craig.topper added reviewers: RKSimon, spatel.

If we widen illegal types instead of promoting, we should be able to rely on the type legalizer to create the vector_inreg operations for us with some caveats.

This patch disables combineToExtendVectorInReg when we are using widening.

I've enabled custom legalization for v8i8->v8i64 extends under avx512f since the type legalizer would want to create a vector_inreg with a v64i8 input type which isn't legal without avx512bw. So we go to v16i8 with custom code using the relaxation of rules we get from https://reviews.llvm.org/D54346.

I've also enable custom legalization of v8i64 and v16i32 operations with with AVX. When the input type is 128 bits, the default splitting legalization would extend first 128->256, then do the a split to two 128 pieces. Extend each half to 256 and then concat the result. The custom legalization I've added instead uses a 128->256 bit vector_inreg extend that only reads the lower 64-bits for the low half of the split. Then shuffles the high 64-bits to the low 64-bits and does another vector_inreg extend.


https://reviews.llvm.org/D54467

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/vec_int_to_fp-widen.ll
  test/CodeGen/X86/vector-sext-widen.ll
  test/CodeGen/X86/vector-zext-widen.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54467.173817.patch
Type: text/x-patch
Size: 23890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181113/a950e64d/attachment.bin>


More information about the llvm-commits mailing list