Skip to content

Commit 85aff1a

Browse files
fhahngithub-actions[bot]
authored andcommitted
Automerge: [VPLan] Reduce duplication in VPHeaderPHIRecipe::classof. (NFCI)
Implement VPHeaderPHIRecipe::classof(const VPValue *V) in terms of the variant taking VPRecipeBase. Reduces some duplication, split off from llvm/llvm-project#141431.
2 parents 13a4da4 + 7b94dd3 commit 85aff1a

File tree

1 file changed

+4
-6
lines changed
  • llvm/lib/Transforms/Vectorize

1 file changed

+4
-6
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,14 +2065,12 @@ class LLVM_ABI_FOR_TEST VPHeaderPHIRecipe : public VPSingleDefRecipe,
20652065
~VPHeaderPHIRecipe() override = default;
20662066

20672067
/// Method to support type inquiry through isa, cast, and dyn_cast.
2068-
static inline bool classof(const VPRecipeBase *B) {
2069-
return B->getVPDefID() >= VPDef::VPFirstHeaderPHISC &&
2070-
B->getVPDefID() <= VPDef::VPLastHeaderPHISC;
2068+
static inline bool classof(const VPRecipeBase *R) {
2069+
return R->getVPDefID() >= VPDef::VPFirstHeaderPHISC &&
2070+
R->getVPDefID() <= VPDef::VPLastHeaderPHISC;
20712071
}
20722072
static inline bool classof(const VPValue *V) {
2073-
auto *B = V->getDefiningRecipe();
2074-
return B && B->getVPDefID() >= VPRecipeBase::VPFirstHeaderPHISC &&
2075-
B->getVPDefID() <= VPRecipeBase::VPLastHeaderPHISC;
2073+
return isa<VPHeaderPHIRecipe>(V->getDefiningRecipe());
20762074
}
20772075

20782076
/// Generate the phi nodes.

0 commit comments

Comments
 (0)