Skip to content

[VPlan] Remove VPPredInstPHIRecipe::useScalars #143798

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

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

Conversation

lukel97
Copy link
Contributor

@lukel97 lukel97 commented Jun 11, 2025

It uses the vector value of its operand if possible. Use the default definition in VPUser, which is false since onlyFirstLaneUsed is false.

From the discussion at #142594 (comment)

I don't think this is strictly NFC but I couldn't really think of a way to come up for a test case for it

It uses the vector value of its operand if possible. Use the default definition in VPUser, which is false since onlyFirstLaneUsed is false.

From the discussion at llvm#142594 (comment)
@llvmbot
Copy link
Member

llvmbot commented Jun 11, 2025

@llvm/pr-subscribers-vectorizers

@llvm/pr-subscribers-llvm-transforms

Author: Luke Lau (lukel97)

Changes

It uses the vector value of its operand if possible. Use the default definition in VPUser, which is false since onlyFirstLaneUsed is false.

From the discussion at #142594 (comment)


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

1 Files Affected:

  • (modified) llvm/lib/Transforms/Vectorize/VPlan.h (-7)
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index bbcbfee4e471b..5b8a80d5bbd21 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -2951,13 +2951,6 @@ class VPPredInstPHIRecipe : public VPSingleDefRecipe {
   void print(raw_ostream &O, const Twine &Indent,
              VPSlotTracker &SlotTracker) const override;
 #endif
-
-  /// Returns true if the recipe uses scalars of operand \p Op.
-  bool usesScalars(const VPValue *Op) const override {
-    assert(is_contained(operands(), Op) &&
-           "Op must be an operand of the recipe");
-    return true;
-  }
 };
 
 /// A common base class for widening memory operations. An optional mask can be

Copy link
Contributor

@fhahn fhahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh so this doesn't handle the case from #142594 (comment)?

@lukel97
Copy link
Contributor Author

lukel97 commented Jun 12, 2025

oh so this doesn't handle the case from #142594 (comment)?

No it doesn't cause that broadcast to be hoisted, the scalar VP operand is already outside of the loop body.

That case in #142594 I guess just shows how the broadcast itself can be hoisted. But I don't think it's important if LICM is going to do it afterwards anyway

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