@@ -1135,13 +1135,8 @@ class VPPhiAccessors {
11351135 const VPBasicBlock *getIncomingBlock (unsigned Idx) const ;
11361136
11371137 // / Returns the number of incoming values, also number of incoming blocks.
1138- // / Note that at the moment, VPWidenIntOrFpInductionRecipes only have a single
1139- // / incoming value, its start value.
1140- unsigned getNumIncoming () const {
1141- const VPRecipeBase *R = getAsRecipe ();
1142- return R->getVPDefID () == VPDef::VPWidenIntOrFpInductionSC
1143- ? 1
1144- : getAsRecipe ()->getNumOperands ();
1138+ virtual unsigned getNumIncoming () const {
1139+ return getAsRecipe ()->getNumOperands ();
11451140 }
11461141
11471142#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
@@ -1992,6 +1987,11 @@ class VPWidenIntOrFpInductionRecipe : public VPWidenInductionRecipe {
19921987 return isUnrolled () ? getOperand (getNumOperands () - 2 ) : nullptr ;
19931988 }
19941989
1990+ // / Returns the number of incoming values, also number of incoming blocks.
1991+ // / Note that at the moment, VPWidenIntOrFpInductionRecipes only have a single
1992+ // / incoming value, its start value.
1993+ unsigned getNumIncoming () const override { return 1 ; }
1994+
19951995 // / Returns the first defined value as TruncInst, if it is one or nullptr
19961996 // / otherwise.
19971997 TruncInst *getTruncInst () { return Trunc; }
@@ -3310,9 +3310,6 @@ struct CastInfo<VPPhiAccessors, const VPRecipeBase *>
33103310
33113311 using Self = CastInfo<VPPhiAccessors, const VPRecipeBase *>;
33123312
3313- using CastReturnType =
3314- typename cast_retty<VPPhiAccessors, VPRecipeBase *>::ret_type;
3315-
33163313 static inline VPPhiAccessors *doCast (const VPRecipeBase *R) {
33173314 return const_cast <VPPhiAccessors *>([R]() -> const VPPhiAccessors * {
33183315 switch (R->getVPDefID ()) {
@@ -3328,11 +3325,9 @@ struct CastInfo<VPPhiAccessors, const VPRecipeBase *>
33283325 }());
33293326 }
33303327
3331- static inline VPPhiAccessors *castFailed () { return nullptr ; }
3332-
33333328 static inline VPPhiAccessors *doCastIfPossible (const VPRecipeBase *f) {
33343329 if (!Self::isPossible (f))
3335- return castFailed () ;
3330+ return nullptr ;
33363331 return doCast (f);
33373332 }
33383333};
0 commit comments