Skip to content

Conversation

fhahn
Copy link
Contributor

@fhahn fhahn commented May 4, 2025

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 #124838.

@fhahn fhahn requested review from rengolin, ayalz and aniragil May 4, 2025 21:02
fhahn added a commit that referenced this pull request May 15, 2025
…24838)

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 #138472 to
retrieve incoming values & corresponding blocks for phi-like recipes.

PR: #124838
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
TIFitis pushed a commit to TIFitis/llvm-project that referenced this pull request May 19, 2025
…vm#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#138472 to
retrieve incoming values & corresponding blocks for phi-like recipes.

PR: llvm#124838
@fhahn fhahn requested review from lukel97 and alexey-bataev August 1, 2025 14:11
Copy link
Contributor Author

@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.

ping :)

Copy link
Contributor

@lukel97 lukel97 left a comment

Choose a reason for hiding this comment

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

Does the PR title need updated? VPPhiAccessors was already added in #129388, this is adding more methods to it right?

@fhahn fhahn changed the title [VPlan] Add VPPhiAccessors to provide interface for phi recipes (NFC) [VPlan] Add incoming_[blocks,values] iterators to VPPhiAccessors (NFC) Aug 6, 2025
Copy link
Contributor Author

@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.

Does the PR title need updated? VPPhiAccessors was already added in #129388, this is adding more methods to it right?

Yep, updated, thanks

Copy link
Contributor

@artagnon artagnon left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

if (!EdgeMask) {
assert(In == 0 && "Both null and non-null edge masks found");
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess there's not an easy way to preserve this assert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope unfortunately not :(

Comment on lines +253 to +254
for (const auto &[IncomingVPV, IncomingVPBB] :
Phi->incoming_values_and_blocks()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

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())

@lukel97
Copy link
Contributor

lukel97 commented Aug 11, 2025

Reverse ping!

@fhahn fhahn merged commit 177f27d into llvm:main Aug 14, 2025
9 checks passed
@fhahn fhahn deleted the vplan-phi-iterators branch August 14, 2025 15:47
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants