[llvm] ce1be13 - [VPlan] Use VP_CLASSOF_IMPL for VPWidenCanonicalIVRecipe(NFC).

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 09:53:05 PST 2023


Author: Florian Hahn
Date: 2023-01-02T17:52:13Z
New Revision: ce1be13a868d0f8afa367975558c1a6175cce33a

URL: https://github.com/llvm/llvm-project/commit/ce1be13a868d0f8afa367975558c1a6175cce33a
DIFF: https://github.com/llvm/llvm-project/commit/ce1be13a868d0f8afa367975558c1a6175cce33a.diff

LOG: [VPlan] Use VP_CLASSOF_IMPL for VPWidenCanonicalIVRecipe(NFC).

Replace VPWidenCanonicalIVRecipe::classof implementation with general
VP_CLASSOF_IMPL.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/VPlan.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 9d38b4d7e344..cbd47debdd1a 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -1874,20 +1874,8 @@ class VPWidenCanonicalIVRecipe : public VPRecipeBase, public VPValue {
 
   ~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


        


More information about the llvm-commits mailing list