Skip to content

Commit f2c2b8f

Browse files
committed
Address comments.
1 parent 4aba2d3 commit f2c2b8f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,13 +2026,10 @@ InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
20262026
VPCostContext &Ctx) const {
20272027
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
20282028
Type *ElementTy = RdxDesc.getRecurrenceType();
2029-
auto *VectorTy = dyn_cast<VectorType>(ToVectorTy(ElementTy, VF));
2029+
auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
20302030
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
20312031
unsigned Opcode = RdxDesc.getOpcode();
20322032

2033-
if (VectorTy == nullptr)
2034-
return InstructionCost::getInvalid();
2035-
20362033
// Cost = Reduction cost + BinOp cost
20372034
InstructionCost Cost =
20382035
Ctx.TTI.getArithmeticInstrCost(Opcode, ElementTy, CostKind);

0 commit comments

Comments
 (0)