Skip to content

Commit 20f6383

Browse files
committed
Manually implement classof of VPReductionRecipe.
1 parent c85020f commit 20f6383

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,15 @@ class VPReductionRecipe : public VPSingleDefRecipe {
21972197
getVecOp(), getCondOp(), IsOrdered);
21982198
}
21992199

2200-
VP_CLASSOF_IMPL(VPDef::VPReductionSC)
2200+
static inline bool classof(const VPRecipeBase *R) {
2201+
return R->getVPDefID() == VPRecipeBase::VPReductionSC ||
2202+
R->getVPDefID() == VPRecipeBase::VPReductionEVLSC;
2203+
}
2204+
2205+
static inline bool classof(const VPUser *U) {
2206+
auto *R = dyn_cast<VPRecipeBase>(U);
2207+
return R && classof(R);
2208+
}
22012209

22022210
/// Generate the reduction in the loop
22032211
void execute(VPTransformState &State) override;

llvm/lib/Transforms/Vectorize/VPlanAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Type *VPTypeAnalysis::inferScalarType(const VPValue *V) {
275275
.Case<VPExpandSCEVRecipe>([](const VPExpandSCEVRecipe *R) {
276276
return R->getSCEV()->getType();
277277
})
278-
.Case<VPReductionRecipe, VPReductionEVLRecipe>([this](const auto *R) {
278+
.Case<VPReductionRecipe>([this](const auto *R) {
279279
return inferScalarType(R->getChainOp());
280280
});
281281

0 commit comments

Comments
 (0)