[llvm] [VPlan] Use vputils helper in Blend::usesFirstLaneOnly (NFC) (PR #189697)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 17 02:50:32 PDT 2026
https://github.com/artagnon updated https://github.com/llvm/llvm-project/pull/189697
>From c97b1ecc3438dffed9a0746d7e66cdc650d3da07 Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <artagnon at tenstorrent.com>
Date: Tue, 31 Mar 2026 16:44:13 +0100
Subject: [PATCH 1/2] [VPlan] Use vputils helper in Blend::usesFirstLaneOnly
(NFC)
---
llvm/lib/Transforms/Vectorize/VPlan.h | 9 +--------
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 7 +++++++
2 files changed, 8 insertions(+), 8 deletions(-)
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..68aa00d5db60f 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -4668,6 +4668,13 @@ 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");
+ // Recursing through Blend recipes only, must terminate at header phi's the
+ // latest.
+ return vputils::onlyFirstLaneUsed(this);
+}
+
void VPWidenPHIRecipe::execute(VPTransformState &State) {
Value *Op0 = State.get(getOperand(0));
Type *VecTy = Op0->getType();
>From f37f683bfa124ec411e75cc0b121d5c5b9cad438 Mon Sep 17 00:00:00 2001
From: Ramkumar Ramachandra <artagnon at tenstorrent.com>
Date: Fri, 17 Apr 2026 10:49:06 +0100
Subject: [PATCH 2/2] [VPlan] Strip bad comment
---
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index 68aa00d5db60f..763b2cbc99461 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -4670,8 +4670,6 @@ void VPReductionPHIRecipe::printRecipe(raw_ostream &O, const Twine &Indent,
bool VPBlendRecipe::usesFirstLaneOnly(const VPValue *Op) const {
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 vputils::onlyFirstLaneUsed(this);
}
More information about the llvm-commits
mailing list