[VPlan] Add incoming_[blocks,values] iterators to VPPhiAccessors (NFC) #138472
Merged
Conversation
Add a VPPhiAccessors class to provide interfaces to access incoming values and blocks, with corresponding iterators. The first user is VPWidenPhiRecipe, with the other phi-like recipes following soon. This will also be used to verify def-use chains where users are phi-like recipes, simplifying llvm#124838.
[VPlan] Use VPPhiAccessors for VPIRPhi. astOf
Add iterators for incoming values, blocks and values and blocks combined, to encourage processing values and their corresponding blocks together.
llvm-sync Bot
pushed a commit
to arm/arm-toolchain
that referenced
this pull request
May 15, 2025
…ecipes. (#124838) Update the verifier to verify dominance for incoming values for phi-like recipes. The defining recipe must dominate the incoming block for the incoming value. Builds on top of llvm/llvm-project#138472 to retrieve incoming values & corresponding blocks for phi-like recipes. PR: llvm/llvm-project#124838
artagnon
reviewed
Aug 1, 2025
artagnon
reviewed
Aug 6, 2025
fhahn
commented
Aug 6, 2025
lukel97
approved these changes
Aug 7, 2025
| OperandsWithMask.push_back(InVPV); | ||
| VPValue *EdgeMask = getEdgeMask(InVPBB, VPBB); | ||
| if (!EdgeMask) { | ||
| assert(In == 0 && "Both null and non-null edge masks found"); |
Contributor
There was a problem hiding this comment.
I guess there's not an easy way to preserve this assert?
Contributor
Author
There was a problem hiding this comment.
Nope unfortunately not :(
Comment on lines
+253
to
+254
| for (const auto &[IncomingVPV, IncomingVPBB] : | ||
| Phi->incoming_values_and_blocks()) { |
Contributor
There was a problem hiding this comment.
Not majorly important but if you wanted to preserve the error message you could do const auto &[Idx, IncomingVPV, IncomingVPBB] : enumerate(Phi->incoming_values(), Phi->incoming_blocks())
Contributor
|
Reverse ping! |
llvm-sync Bot
pushed a commit
to arm/arm-toolchain
that referenced
this pull request
Aug 14, 2025
…essors (NFC) (#138472) Add 3 new iterator ranges to VPPhiAccessors * incoming_values(): returns a range over the incoming values of a phi * incoming_blocks(): returns a range over the incoming blocks of a phi * incoming_values_and_blocks: returns a range over pairs of incoming values and blocks. Depends on llvm/llvm-project#124838. PR: llvm/llvm-project#138472
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.
Add 3 new iterator ranges to VPPhiAccessors
values of a phi
blocks of a phi
incoming values and blocks.
Depends on #124838.