From: Craig Topper Date: Tue, 12 Nov 2019 20:26:18 +0000 (-0800) Subject: [X86] Only pass v64i8/v32i16 as v16i32 on non-avx512bw targets if the v16i32 type... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f04ffc073deeb1738f1d9bd5c8161d13fe42592;p=platform%2Fupstream%2Fllvm.git [X86] Only pass v64i8/v32i16 as v16i32 on non-avx512bw targets if the v16i32 type won't be split by prefer-vector-width=256 Otherwise just let the v64i8/v32i16 types be split to v32i8/v16i16. In reality this shouldn't happen because it means we have a 512-bit vector argument, but min-legal-vector-width says a value less than 512. But a 512-bit argument should have been factored into the preferred vector width. --- diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 87ff5f9..df5e16c 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -1938,8 +1938,8 @@ MVT X86TargetLowering::getRegisterTypeForCallingConv(LLVMContext &Context, (VT.getVectorNumElements() > 64 && Subtarget.hasBWI()))) return MVT::i8; // FIXME: Should we just make these types legal and custom split operations? - if ((VT == MVT::v32i16 || VT == MVT::v64i8) && - Subtarget.hasAVX512() && !Subtarget.hasBWI() && !EnableOldKNLABI) + if ((VT == MVT::v32i16 || VT == MVT::v64i8) && !EnableOldKNLABI && + Subtarget.useAVX512Regs() && !Subtarget.hasBWI()) return MVT::v16i32; return TargetLowering::getRegisterTypeForCallingConv(Context, CC, VT); } @@ -1958,8 +1958,8 @@ unsigned X86TargetLowering::getNumRegistersForCallingConv(LLVMContext &Context, (VT.getVectorNumElements() > 64 && Subtarget.hasBWI()))) return VT.getVectorNumElements(); // FIXME: Should we just make these types legal and custom split operations? - if ((VT == MVT::v32i16 || VT == MVT::v64i8) && - Subtarget.hasAVX512() && !Subtarget.hasBWI() && !EnableOldKNLABI) + if ((VT == MVT::v32i16 || VT == MVT::v64i8) && !EnableOldKNLABI && + Subtarget.useAVX512Regs() && !Subtarget.hasBWI()) return 1; return TargetLowering::getNumRegistersForCallingConv(Context, CC, VT); }