[VPlan] Use VP_CLASSOF_IMPL for VPWidenCanonicalIVRecipe(NFC).
authorFlorian Hahn <flo@fhahn.com>
Mon, 2 Jan 2023 17:52:12 +0000 (17:52 +0000)
committerFlorian Hahn <flo@fhahn.com>
Mon, 2 Jan 2023 17:52:13 +0000 (17:52 +0000)
Replace VPWidenCanonicalIVRecipe::classof implementation with general
VP_CLASSOF_IMPL.

llvm/lib/Transforms/Vectorize/VPlan.h

index 9d38b4d..cbd47de 100644 (file)
@@ -1874,20 +1874,8 @@ public:
 
   ~VPWidenCanonicalIVRecipe() override = default;
 
-  /// Method to support type inquiry through isa, cast, and dyn_cast.
-  static inline bool classof(const VPDef *D) {
-    return D->getVPDefID() == VPRecipeBase::VPWidenCanonicalIVSC;
-  }
-
-  /// Extra classof implementations to allow directly casting from VPUser ->
-  /// VPWidenCanonicalIVRecipe.
-  static inline bool classof(const VPUser *U) {
-    auto *R = dyn_cast<VPRecipeBase>(U);
-    return R && R->getVPDefID() == VPRecipeBase::VPWidenCanonicalIVSC;
-  }
-  static inline bool classof(const VPRecipeBase *R) {
-    return R->getVPDefID() == VPRecipeBase::VPWidenCanonicalIVSC;
-  }
+  VP_CLASSOF_IMPL(VPRecipeBase::VPWidenCanonicalIVSC,
+                  VPValue::VPVWidenCanonicalIVSC)
 
   /// Generate a canonical vector induction variable of the vector loop, with
   /// start = {<Part*VF, Part*VF+1, ..., Part*VF+VF-1> for 0 <= Part < UF}, and