diff options
| author | Craig Topper <craig.topper@intel.com> | 2017-11-27 22:56:10 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2017-11-27 22:56:10 +0000 |
| commit | 256cc48df62c8dc394ee71ebec85b8b10eb1cddf (patch) | |
| tree | 9a57a7d8639c66693d689d1de64174d16f2a3fb1 /llvm/lib | |
| parent | 6163329caac52477885d6915c1eac533b9cbb89d (diff) | |
| download | bcm5719-llvm-256cc48df62c8dc394ee71ebec85b8b10eb1cddf.tar.gz bcm5719-llvm-256cc48df62c8dc394ee71ebec85b8b10eb1cddf.zip | |
[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
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 4580466f090..3dd265ff0c2 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -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); |

