Page MenuHomePhabricator

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

Authored by fhahn on Sat, Jan 2, 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.Sat, Jan 2, 3:05 AM
fhahn requested review of this revision.Sat, Jan 2, 3:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptSat, Jan 2, 3:05 AM
Herald added a subscriber: vkmr. · View Herald Transcript
fhahn updated this revision to Diff 314587.Tue, Jan 5, 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.Tue, Jan 5, 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
4595

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

4599

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

fhahn updated this revision to Diff 314883.Wed, Jan 6, 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.Wed, Jan 6, 6:48 AM
fhahn added inline comments.
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
4599

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

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

LGTM!

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

rebase after parent patch landed.

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