[llvm] 6383afb - [VPlan] Use vputils helper in Blend::usesFirstLaneOnly (NFC) (#189697)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 03:31:46 PDT 2026
Author: Ramkumar Ramachandra
Date: 2026-04-17T10:31:40Z
New Revision: 6383afba60e16a9b5b9c62e68fe214f870dd3183
URL: https://github.com/llvm/llvm-project/commit/6383afba60e16a9b5b9c62e68fe214f870dd3183
DIFF: https://github.com/llvm/llvm-project/commit/6383afba60e16a9b5b9c62e68fe214f870dd3183.diff
LOG: [VPlan] Use vputils helper in Blend::usesFirstLaneOnly (NFC) (#189697)
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index c53952941033c..343d39d2e5566 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -2846,14 +2846,7 @@ class LLVM_ABI_FOR_TEST VPBlendRecipe : public VPRecipeWithIRFlags {
VPCostContext &Ctx) const override;
/// Returns true if the recipe only uses the first lane of operand \p Op.
- bool usesFirstLaneOnly(const VPValue *Op) const override {
- assert(is_contained(operands(), Op) &&
- "Op must be an operand of the recipe");
- // Recursing through Blend recipes only, must terminate at header phi's the
- // latest.
- return all_of(users(),
- [this](VPUser *U) { return U->usesFirstLaneOnly(this); });
- }
+ bool usesFirstLaneOnly(const VPValue *Op) const override;
protected:
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index a2445b3dac77d..763b2cbc99461 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -4668,6 +4668,11 @@ void VPReductionPHIRecipe::printRecipe(raw_ostream &O, const Twine &Indent,
}
#endif
+bool VPBlendRecipe::usesFirstLaneOnly(const VPValue *Op) const {
+ assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
+ return vputils::onlyFirstLaneUsed(this);
+}
+
void VPWidenPHIRecipe::execute(VPTransformState &State) {
Value *Op0 = State.get(getOperand(0));
Type *VecTy = Op0->getType();
More information about the llvm-commits
mailing list