[VPlan] Remove VPPredInstPHIRecipe::useScalars#143798
Closed
[VPlan] Remove VPPredInstPHIRecipe::useScalars#143798
Conversation
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)
Member
|
@llvm/pr-subscribers-vectorizers @llvm/pr-subscribers-llvm-transforms Author: Luke Lau (lukel97) ChangesIt 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) 1 Files Affected:
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
|
fhahn
reviewed
Jun 12, 2025
Contributor
fhahn
left a comment
There was a problem hiding this comment.
oh so this doesn't handle the case from #142594 (comment)?
Contributor
Author
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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