-
Notifications
You must be signed in to change notification settings - Fork 13.7k
[VPlan] Allow VPWidenPHI in non-native path. NFC #118662
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
Closed
lukel97
wants to merge
5
commits into
llvm:main
from
lukel97:loop-vectorize/split-VPWidenPHIRecipe-debug-and-nonnative-vplan
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
431d6d9
[LV] Allow VPWidenPHI in non-native path and copy DebugLoc
lukel97 cda41c6
Update comment
lukel97 f31878c
Rename fixNonInductionPHIs back
lukel97 69d4076
Update comments to clarify which parts can only be used in the vplan-…
lukel97 46ae402
Remove DebugLoc changes
lukel97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2287,10 +2287,16 @@ class VPWidenPHIRecipe : public VPSingleDefRecipe { | |
/// List of incoming blocks. Only used in the VPlan native path. | ||
SmallVector<VPBasicBlock *, 2> IncomingBlocks; | ||
|
||
/// Name to use for the generated IR instruction for the widened IV. | ||
std::string Name; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use SmallString or Twine? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. std::string seems to be what everything else in VPlan.h uses, and it doesn't look like Twine can be stored |
||
|
||
public: | ||
/// Create a new VPWidenPHIRecipe for \p Phi with start value \p Start. | ||
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr) | ||
: VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi) { | ||
VPWidenPHIRecipe(PHINode *Phi, VPValue *Start = nullptr, | ||
const Twine &Name = "vec.phi") | ||
: VPSingleDefRecipe(VPDef::VPWidenPHISC, ArrayRef<VPValue *>(), Phi, | ||
Phi->getDebugLoc()), | ||
Name(Name.str()) { | ||
if (Start) | ||
addOperand(Start); | ||
} | ||
|
@@ -2312,13 +2318,15 @@ class VPWidenPHIRecipe : public VPSingleDefRecipe { | |
VPSlotTracker &SlotTracker) const override; | ||
#endif | ||
|
||
/// Adds a pair (\p IncomingV, \p IncomingBlock) to the phi. | ||
/// Adds a pair (\p IncomingV, \p IncomingBlock) to the phi. Only used in the | ||
/// VPlan native path. | ||
void addIncoming(VPValue *IncomingV, VPBasicBlock *IncomingBlock) { | ||
addOperand(IncomingV); | ||
IncomingBlocks.push_back(IncomingBlock); | ||
} | ||
|
||
/// Returns the \p I th incoming VPBasicBlock. | ||
/// Returns the \p I th incoming VPBasicBlock. Only used in the VPlan native | ||
/// path. | ||
VPBasicBlock *getIncomingBlock(unsigned I) { return IncomingBlocks[I]; } | ||
|
||
/// Returns the \p I th incoming VPValue. | ||
|
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe update the comments above re: usage in vplan native? Given this is now used in both paths, do these need delete or clarified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IncomingBlocks should still only be used in the vplan native path, so I've added more comments to the other methods that should only be called from it