Skip to content

Commit 041f41b

Browse files
committed
Fixup! Remove legacy model query
1 parent 28b82ca commit 041f41b

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7137,14 +7137,6 @@ bool VPCostContext::skipCostComputation(Instruction *UI, bool IsVector) const {
71377137
SkipCostComputation.contains(UI);
71387138
}
71397139

7140-
bool VPCostContext::isInLoopReduction(const Instruction *UI, ElementCount VF,
7141-
Type *VectorTy) const {
7142-
return CM
7143-
.getReductionPatternCost(const_cast<Instruction *>(UI), VF, VectorTy,
7144-
TTI::TCK_RecipThroughput)
7145-
.has_value();
7146-
}
7147-
71487140
InstructionCost
71497141
LoopVectorizationPlanner::precomputeCosts(VPlan &Plan, ElementCount VF,
71507142
VPCostContext &CostCtx) const {

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,6 @@ struct VPCostContext {
718718
/// Return true if the cost for \p UI shouldn't be computed, e.g. because it
719719
/// has already been pre-computed.
720720
bool skipCostComputation(Instruction *UI, bool IsVector) const;
721-
722-
/// Return true if the \p UI is part of the in-loop reduction.
723-
bool isInLoopReduction(const Instruction *UI, ElementCount VF,
724-
Type *VectorTy) const;
725721
};
726722

727723
/// VPRecipeBase is a base class modeling a sequence of one or more output IR

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,13 +2079,14 @@ InstructionCost VPReductionRecipe::computeCost(ElementCount VF,
20792079
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
20802080
unsigned Opcode = RdxDesc.getOpcode();
20812081

2082-
// TODO: Support any-of reduction and in-loop reductions.
2082+
// TODO: Support any-of and in-loop reductions.
20832083
assert(
20842084
(!RecurrenceDescriptor::isAnyOfRecurrenceKind(RdxKind) ||
20852085
ForceTargetInstructionCost.getNumOccurrences() > 0) &&
20862086
"Any-of reduction not implemented in VPlan-based cost model currently.");
2087+
auto *ReductionPHIRecipe = dyn_cast<VPReductionPHIRecipe>(getOperand(0));
20872088
assert(
2088-
(!Ctx.isInLoopReduction(getUnderlyingInstr(), VF, VectorTy) ||
2089+
(ReductionPHIRecipe && !ReductionPHIRecipe->isInLoop() ||
20892090
ForceTargetInstructionCost.getNumOccurrences() > 0) &&
20902091
"In-loop reduction not implemented in VPlan-based cost model currently.");
20912092

0 commit comments

Comments
 (0)