From b1c58d49d9c5fcef6c8224feae4c9f35c4d3d527 Mon Sep 17 00:00:00 2001 From: Michael Maitland Date: Fri, 30 Aug 2024 18:53:10 -0700 Subject: [PATCH] [VPlan] Add ExplicitVectorLength to isSingleScalar The docstring of this function: > Returns true if this VPInstruction's operands are single scalars and the > result is also a single scalar. ExplicitVectorLength fits this description. I don't have a test for it now, but it is needed by #106560. --- llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp index f84317ba51257..5877aae81a795 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp @@ -680,7 +680,8 @@ bool VPInstruction::isVectorToScalar() const { } bool VPInstruction::isSingleScalar() const { - return getOpcode() == VPInstruction::ResumePhi; + return getOpcode() == VPInstruction::ResumePhi || + getOpcode() == VPInstruction::ExplicitVectorLength; } #if !defined(NDEBUG)