[X86] Teach getSetCCResultType to handle more than just SimpleVTs when looking at larger than 512-bit vectors.

Which VTs are considered simple is determined by the superset of the legal types of all targets in LLVM. If we're looking at VTs that are going to be split down to 512-bits we should allow any VT not just simple ones since the simple list changes over time as new targets are added.

llvm-svn: 319110
This commit is contained in:
Craig Topper 2017-11-27 22:56:10 +00:00
parent 6163329caa
commit 256cc48df6
2 changed files with 69 additions and 1022 deletions

View File

@ -1716,25 +1716,22 @@ EVT X86TargetLowering::getSetCCResultType(const DataLayout &DL,
if (!VT.isVector())
return MVT::i8;
if (VT.getSizeInBits() >= 512) {
EVT EltVT = VT.getVectorElementType();
const unsigned NumElts = VT.getVectorNumElements();
if (Subtarget.hasAVX512())
if (EltVT == MVT::i32 || EltVT == MVT::i64 ||
EltVT == MVT::f32 || EltVT == MVT::f64)
return EVT::getVectorVT(Context, MVT::i1, NumElts);
if (Subtarget.hasBWI())
if (EltVT == MVT::i8 || EltVT == MVT::i16)
return EVT::getVectorVT(Context, MVT::i1, NumElts);
}
if (VT.isSimple()) {
MVT VVT = VT.getSimpleVT();
const unsigned NumElts = VVT.getVectorNumElements();
MVT EltVT = VVT.getVectorElementType();
if (VVT.getSizeInBits() >= 512) {
if (Subtarget.hasAVX512())
if (EltVT == MVT::i32 || EltVT == MVT::i64 ||
EltVT == MVT::f32 || EltVT == MVT::f64)
switch(NumElts) {
case 8: return MVT::v8i1;
case 16: return MVT::v16i1;
}
if (Subtarget.hasBWI())
if (EltVT == MVT::i8 || EltVT == MVT::i16)
switch(NumElts) {
case 32: return MVT::v32i1;
case 64: return MVT::v64i1;
}
}
if (Subtarget.hasBWI() && Subtarget.hasVLX())
return MVT::getVectorVT(MVT::i1, NumElts);

File diff suppressed because it is too large Load Diff