This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] Summarize recipes used to model inductions.
ClosedPublic

Authored by fhahn on Nov 26 2022, 2:02 PM.

Diff Detail

Event Timeline

fhahn created this revision.Nov 26 2022, 2:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 26 2022, 2:02 PM
fhahn requested review of this revision.Nov 26 2022, 2:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 26 2022, 2:02 PM
Ayal added a comment.Nov 27 2022, 3:12 PM

Thanks for following up! Adding some thoughts to consider.

llvm/lib/Transforms/Vectorize/VPlan.h
1133

Worth indicating which of these produce a value per iteration, per part, per lane?

1135

Worth adding that this induction controls the vector loop, by comparing it with the vector trip count?
Starting value is specified as zero for main vector loop or where the main vector loop left off for the epilog vector loop (until fixed..).

1137

Worth adding that this is done by introducing an independent vector header phi?

1139

So perhaps a more consistent name would be VPScalarIntOrFpInductionRecipe?
Worth adding that these scalar values are computed based on the canonical IV recipe, rather than forming additional header phi's.

1141

So perhaps a more consistent name would be VPPointerInductionRecipe?

fhahn updated this revision to Diff 481868.Dec 10 2022, 9:40 AM
fhahn marked an inline comment as done.

Update comments, also document derived IV.

fhahn marked 4 inline comments as done.Dec 10 2022, 9:41 AM
fhahn added inline comments.
llvm/lib/Transforms/Vectorize/VPlan.h
1133

Thanks, updated!

1135

Added, thanks!

1139

Updated the wording, but kept the name for now to just reflect the current realities in the documentation, thanks!

1141

I am planning to handle the non-widening case by using derived IV + scalar steps in future patches.

Ayal accepted this revision.Dec 10 2022, 2:58 PM

Ship it, thanks!
Add [NFC] to title?
Relate to recent IV recipe patches in commit message?

llvm/lib/Transforms/Vectorize/VPlan.h
1138

nit: worth emphasizing - "a [single] scalar PHI"

1141

nit: "vector phis for each part" >> "a vector PHI per-part", to be more consistent with above and below?

1143

"Produces a single scalar value per iteration"

1147

"vector phis" - better use either "phi" or "PHI" consistently.

Worth adding that vector phis are produced per-part and scalar values per-lane?

This revision is now accepted and ready to land.Dec 10 2022, 2:58 PM
This revision was automatically updated to reflect the committed changes.
fhahn marked 7 inline comments as done.
fhahn added a comment.Dec 11 2022, 8:29 AM

Thanks, comments should be addressed in the committed version!