Skip to content

Commit 561b1a9

Browse files
committed
Change back LogicalAnd and add assert for its operand
1 parent f7b716d commit 561b1a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,17 @@ Type *VPTypeAnalysis::inferScalarTypeForRecipe(const VPInstruction *R) {
7777
case VPInstruction::CalculateTripCountMinusVF:
7878
case VPInstruction::CanonicalIVIncrementForPart:
7979
case VPInstruction::AnyOf:
80-
case VPInstruction::LogicalAnd:
8180
return SetResultTyFromOp();
8281
case VPInstruction::ExtractFromEnd: {
8382
Type *BaseTy = inferScalarType(R->getOperand(0));
8483
if (auto *VecTy = dyn_cast<VectorType>(BaseTy))
8584
return VecTy->getElementType();
8685
return BaseTy;
8786
}
87+
case VPInstruction::LogicalAnd:
88+
assert(inferScalarType(R->getOperand(0))->isIntegerTy(1) &&
89+
"LogicalAnd operand should be bool");
90+
return IntegerType::get(Ctx, 1);
8891
case VPInstruction::PtrAdd:
8992
// Return the type based on the pointer argument (i.e. first operand).
9093
return inferScalarType(R->getOperand(0));

0 commit comments

Comments
 (0)