Skip to content

Commit 65deac0

Browse files
committed
[VPlan] Remove vector type checking in inferScalartType (NFC).
inferScalarTypeForRecipe always infers a scalar type, so BaseTy must be a scalar type. Remove unneeded cast.
1 parent 4e05d70 commit 65deac0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,8 @@ Type *VPTypeAnalysis::inferScalarTypeForRecipe(const VPInstruction *R) {
120120
case VPInstruction::LastActiveLane:
121121
return Type::getIntNTy(Ctx, 64);
122122
case VPInstruction::ExtractLastLane:
123-
case VPInstruction::ExtractPenultimateElement: {
124-
Type *BaseTy = inferScalarType(R->getOperand(0));
125-
if (auto *VecTy = dyn_cast<VectorType>(BaseTy))
126-
return VecTy->getElementType();
127-
return BaseTy;
128-
}
123+
case VPInstruction::ExtractPenultimateElement:
124+
return inferScalarType(R->getOperand(0));
129125
case VPInstruction::ExtractLastPart:
130126
return inferScalarType(R->getOperand(0));
131127
case VPInstruction::LogicalAnd:

0 commit comments

Comments
 (0)