Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VPlan] Add ExplicitVectorLength to isSingleScalar #106818

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michaelmaitland
Copy link
Contributor

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.

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 llvm#106560.
@llvmbot
Copy link
Member

llvmbot commented Aug 31, 2024

@llvm/pr-subscribers-llvm-transforms

Author: Michael Maitland (michaelmaitland)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/106818.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp (+2-1)
diff --git a/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp b/llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
index f84317ba51257a..5877aae81a7955 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)

@artagnon
Copy link
Contributor

While I appreciate that this is not going to be easy to test, I believe a test is a hard requirement to support the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants