[llvm] 0f04ffc - [X86] Only pass v64i8/v32i16 as v16i32 on non-avx512bw targets if the v16i32 type won't be split by prefer-vector-width=256
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 12 14:56:14 PST 2019
Author: Craig Topper
Date: 2019-11-12T14:56:01-08:00
New Revision: 0f04ffc073deeb1738f1d9bd5c8161d13fe42592
URL: https://github.com/llvm/llvm-project/commit/0f04ffc073deeb1738f1d9bd5c8161d13fe42592
DIFF: https://github.com/llvm/llvm-project/commit/0f04ffc073deeb1738f1d9bd5c8161d13fe42592.diff
LOG: [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.
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 87ff5f95b166..df5e16c6a54b 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);
}
More information about the llvm-commits
mailing list