SelectionDAG: Teach the legalizer to split SETCC if VSELECT needs splitting too.
[oota-llvm.git] / lib / Target / X86 / X86ISelLowering.cpp
index 5dbef0f6fc334d72bc4307e706cdadfb41f42695..18064fc61597099bf567daaebdc439dd04e7fb21 100644 (file)
@@ -1546,7 +1546,16 @@ void X86TargetLowering::resetOperationActions() {
 }
 
 EVT X86TargetLowering::getSetCCResultType(LLVMContext &, EVT VT) const {
-  if (!VT.isVector()) return MVT::i8;
+  if (!VT.isVector())
+    return MVT::i8;
+
+  const TargetMachine &TM = getTargetMachine();
+  if (!TM.Options.UseSoftFloat && Subtarget->hasAVX512())
+    switch(VT.getVectorNumElements()) {
+    case  8: return MVT::v8i1;
+    case 16: return MVT::v16i1;
+    }
+
   return VT.changeVectorElementTypeToInteger();
 }