Skip to content

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