[llvm] 3056add - [VPlan] Rename Expression::isSingleScalar (NFC) (#199041)
via llvm-commits
llvm-commits at lists.llvm.org
Mon May 25 05:12:35 PDT 2026
Author: Ramkumar Ramachandra
Date: 2026-05-25T12:10:35Z
New Revision: 3056add6389b58656092edf9fed75ca6d55a9d9d
URL: https://github.com/llvm/llvm-project/commit/3056add6389b58656092edf9fed75ca6d55a9d9d
DIFF: https://github.com/llvm/llvm-project/commit/3056add6389b58656092edf9fed75ca6d55a9d9d.diff
LOG: [VPlan] Rename Expression::isSingleScalar (NFC) (#199041)
The single-scalar terminology, as it is used in other places indicates
that all operands are scalars and that the result is a scalar.
VPExpressionRecipe::isSingleScalar is a misnomer, and is actually a
vector-to-scalar, using the existing terminology. Rename it for clarity.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.h
llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 7025f39decaf5..6cdd7d12b4a1c 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -3555,8 +3555,8 @@ class VPExpressionRecipe : public VPSingleDefRecipe {
/// effects.
bool mayHaveSideEffects() const;
- /// Returns true if the result of this VPExpressionRecipe is a single-scalar.
- bool isSingleScalar() const;
+ /// Returns true if this VPExpressionRecipe produces a single scalar.
+ bool isVectorToScalar() const;
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 c843d99af9ffb..59d79a89237ce 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
@@ -3219,9 +3219,7 @@ bool VPExpressionRecipe::mayHaveSideEffects() const {
return false;
}
-bool VPExpressionRecipe::isSingleScalar() const {
- // Cannot use vputils::isSingleScalar(), because all external operands
- // of the expression will be live-ins while bundled.
+bool VPExpressionRecipe::isVectorToScalar() const {
auto *RR = dyn_cast<VPReductionRecipe>(ExpressionRecipes.back());
return RR && !RR->isPartialReduction();
}
diff --git a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
index 165a88d4924fc..e4527363a5535 100644
--- a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
@@ -418,7 +418,7 @@ bool vputils::isSingleScalar(const VPValue *VPV) {
VPV))
return true;
if (auto *Expr = dyn_cast<VPExpressionRecipe>(VPV))
- return Expr->isSingleScalar();
+ return Expr->isVectorToScalar();
// VPExpandSCEVRecipes must be placed in the entry and are always uniform.
return isa<VPExpandSCEVRecipe>(VPV);
More information about the llvm-commits
mailing list