Skip to content

Commit 86140e0

Browse files
committed
Address comments.
1 parent 49aead5 commit 86140e0

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
@@ -2016,13 +2016,10 @@ InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
20162016
VPCostContext &Ctx) const {
20172017
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
20182018
Type *ElementTy = RdxDesc.getRecurrenceType();
2019-
auto *VectorTy = dyn_cast<VectorType>(ToVectorTy(ElementTy, VF));
2019+
auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
20202020
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
20212021
unsigned Opcode = RdxDesc.getOpcode();
20222022

2023-
if (VectorTy == nullptr)
2024-
return InstructionCost::getInvalid();
2025-
20262023
// Cost = Reduction cost + BinOp cost
20272024
InstructionCost Cost =
20282025
Ctx.TTI.getArithmeticInstrCost(Opcode, ElementTy, CostKind);

0 commit comments

Comments
 (0)