Skip to content

Commit

Permalink
Address comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvisWang123 committed Sep 25, 2024
1 parent d1360f6 commit c5fb73a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2003,13 +2003,10 @@ InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
VPCostContext &Ctx) const {
RecurKind RdxKind = RdxDesc.getRecurrenceKind();
Type *ElementTy = RdxDesc.getRecurrenceType();
auto *VectorTy = dyn_cast<VectorType>(ToVectorTy(ElementTy, VF));
auto *VectorTy = cast<VectorType>(ToVectorTy(ElementTy, VF));
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
unsigned Opcode = RdxDesc.getOpcode();

if (VectorTy == nullptr)
return InstructionCost::getInvalid();

// Cost = Reduction cost + BinOp cost
InstructionCost Cost =
Ctx.TTI.getArithmeticInstrCost(Opcode, ElementTy, CostKind);
Expand Down

0 comments on commit c5fb73a

Please sign in to comment.