diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h --- a/llvm/lib/Transforms/Vectorize/VPlan.h +++ b/llvm/lib/Transforms/Vectorize/VPlan.h @@ -761,22 +761,6 @@ bool mayReadOrWriteMemory() const { return mayReadFromMemory() || mayWriteToMemory(); } - - /// Returns true if the recipe only uses the first lane of operand \p Op. - /// Conservatively returns false. - virtual bool onlyFirstLaneUsed(const VPValue *Op) const { - assert(is_contained(operands(), Op) && - "Op must be an operand of the recipe"); - return false; - } - - /// Returns true if the recipe uses scalars of operand \p Op. Conservatively - /// returns if only first (scalar) lane is used, as default. - virtual bool usesScalars(const VPValue *Op) const { - assert(is_contained(operands(), Op) && - "Op must be an operand of the recipe"); - return onlyFirstLaneUsed(Op); - } }; inline bool VPUser::classof(const VPDef *Def) { diff --git a/llvm/lib/Transforms/Vectorize/VPlanValue.h b/llvm/lib/Transforms/Vectorize/VPlanValue.h --- a/llvm/lib/Transforms/Vectorize/VPlanValue.h +++ b/llvm/lib/Transforms/Vectorize/VPlanValue.h @@ -287,6 +287,22 @@ /// Method to support type inquiry through isa, cast, and dyn_cast. static inline bool classof(const VPDef *Recipe); + + /// Returns true if the recipe uses scalars of operand \p Op. Conservatively + /// returns if only first (scalar) lane is used, as default. + virtual bool usesScalars(const VPValue *Op) const { + assert(is_contained(operands(), Op) && + "Op must be an operand of the recipe"); + return onlyFirstLaneUsed(Op); + } + + /// Returns true if the recipe only uses the first lane of operand \p Op. + /// Conservatively returns false. + virtual bool onlyFirstLaneUsed(const VPValue *Op) const { + assert(is_contained(operands(), Op) && + "Op must be an operand of the recipe"); + return false; + } }; /// This class augments a recipe with a set of VPValues defined by the recipe.