Skip to content

Commit c5fb73a

Browse files
committed
Address comments.
1 parent d1360f6 commit c5fb73a

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
@@ -2003,13 +2003,10 @@ InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
20032003
VPCostContext &Ctx) const {
20042004
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
20052005
Type *ElementTy = RdxDesc.getRecurrenceType();
2006-
auto *VectorTy = dyn_cast<VectorType>(ToVectorTy(ElementTy, VF));
2006+
auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
20072007
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
20082008
unsigned Opcode = RdxDesc.getOpcode();
20092009

2010-
if (VectorTy == nullptr)
2011-
return InstructionCost::getInvalid();
2012-
20132010
// Cost = Reduction cost + BinOp cost
20142011
InstructionCost Cost =
20152012
Ctx.TTI.getArithmeticInstrCost(Opcode, ElementTy, CostKind);

0 commit comments

Comments
 (0)