Skip to content

Commit 91fcf39

Browse files
committed
Address comments.
1 parent 324659a commit 91fcf39

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
@@ -2075,13 +2075,10 @@ InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
20752075
VPCostContext &Ctx) const {
20762076
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
20772077
Type *ElementTy = RdxDesc.getRecurrenceType();
2078-
auto *VectorTy = dyn_cast<VectorType>(ToVectorTy(ElementTy, VF));
2078+
auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
20792079
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
20802080
unsigned Opcode = RdxDesc.getOpcode();
20812081

2082-
if (VectorTy == nullptr)
2083-
return InstructionCost::getInvalid();
2084-
20852082
// Cost = Reduction cost + BinOp cost
20862083
InstructionCost Cost =
20872084
Ctx.TTI.getArithmeticInstrCost(Opcode, ElementTy, CostKind);

0 commit comments

Comments
 (0)