This is an archive of the discontinued LLVM Phabricator instance.

[VPlan] Keep start value of VPWidenPHIRecipe as VPValue.
ClosedPublic

Authored by fhahn on Jan 2 2021, 3:05 AM.

Details

Summary

Similar to D92129, update VPWidenPHIRecipe to manage the start value as
VPValue. This allows adjusting the start value as a VPlan transform,
which will be used in a follow-up patch to support reductions during
epilogue vectorization.

Diff Detail

Event Timeline

fhahn created this revision.Jan 2 2021, 3:05 AM
fhahn requested review of this revision.Jan 2 2021, 3:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 2 2021, 3:05 AM
Herald added a subscriber: vkmr. · View Herald Transcript
fhahn updated this revision to Diff 314587.Jan 5 2021, 6:21 AM

Update after renaming to getLiveInIRValue.

Also updated documentation for VPWidenPHIRecipe to describe when the start value is managed as first operand.

gilr added a comment.Jan 5 2021, 11:28 AM

I wonder if the code from fixReductions() could be moved (almost as-is) to widenPHIInstruction() as a first step?

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

RK seems to be the only use of RdxDesc. Can be extracted in tryToCreateWidenRecipe() and stored as an ingredient in the recipe.

4593

Intentionally assigning StartV to itself? (symmetry with the else clause?)

fhahn updated this revision to Diff 314883.Jan 6 2021, 6:43 AM

I wonder if the code from fixReductions() could be moved (almost as-is) to widenPHIInstruction() as a first step?

Thanks for the suggestion, I put up D94175 to move the code and keep RdxDesc in the recipe as a first step. The current patch is much simpler now.

fhahn marked an inline comment as done.Jan 6 2021, 6:48 AM
fhahn added inline comments.
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
4593

It's not needed. (can. be Iden = StartV;). Applied to D94175.

gilr accepted this revision.Jan 8 2021, 11:24 PM

LGTM!

This revision is now accepted and ready to land.Jan 8 2021, 11:24 PM
fhahn updated this revision to Diff 315605.Jan 9 2021, 8:31 AM

rebase after parent patch landed.

This revision was landed with ongoing or failed builds.Jan 9 2021, 8:38 AM
This revision was automatically updated to reflect the committed changes.