This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] Add VPWidenPointerInductionRecipe.
ClosedPublic

Authored by fhahn on Mar 14 2022, 9:48 AM.

Details

Summary

This patch moves pointer induction handling from VPWidenPHIRecipe to its
own recipe. In the process, it adds all information required to generate
code for pointer inductions without relying on Legal to access the list
of induction phis.

Alternatively VPWidenPHIRecipe could also take an optional pointer to InductionDescriptor.

Diff Detail

Unit TestsFailed

Event Timeline

fhahn created this revision.Mar 14 2022, 9:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 9:48 AM
fhahn requested review of this revision.Mar 14 2022, 9:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2022, 9:48 AM
Herald added a subscriber: vkmr. · View Herald Transcript
Ayal accepted this revision.Mar 16 2022, 12:23 AM

Nice clean-up, effectively retiring ILV's widenPHIInstruction(), completing its refactoring into more specific recipes.
Adding various nits.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
493–494

Above comment needs updating.

4219–4230

assert(EnableVPlanNativePath && "...") at the outset?

8217

Return a pointer to VPHeaderPhiRecipe ?

8221

Can augment the comment to also mention pointer induction.

8227

Fold into Legal->getPointerInductionDescriptor(Phi)?

9546

Add message to assert.

9607

Should this be refactored out into a SCEV expand recipe (in a follow-up patch)?

llvm/lib/Transforms/Vectorize/VPlan.cpp
1283

getStartValue()?

1285

Can fold on one line.

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

Comment needs updating.

1236

Comment needs completion.

This revision is now accepted and ready to land.Mar 16 2022, 12:23 AM
fhahn updated this revision to Diff 417872.Mar 24 2022, 3:35 AM
fhahn marked 11 inline comments as done.

Thanks Ayal! I address the comments and I plan to land this soon.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
8217

Unfortunately VPWidenIntOrFpInductionRecipe still needs converting to VPHeaderPHIRecipe. this can be done now, after moving all code-gen paths that do not generate a header phi out of the recipe.

9607

Yes!

This revision was landed with ongoing or failed builds.Mar 24 2022, 7:59 AM
This revision was automatically updated to reflect the committed changes.