This is an archive of the discontinued LLVM Phabricator instance.

[LV] Replace stored value with a VPValue (NFCI)
ClosedPublic

Authored by gilr on Mar 18 2020, 10:28 AM.

Details

Summary

InnerLoopVectorizer's code called during VPlan execution still relies on original IR's def-use relations to decide which vector code to generate,
limiting VPlan transformations ability to modify def-use relations and still have ILV generate the vector code.
This patch introduces a VPValue for VPWidenMemoryInstructionRecipe to use as the stored value. The recipe is generated with a VPValue wrapping the stored value of the scalar store.
This reduces ingredient def-use usage by ILV as a step towards full VPlan-based def-use relations.

Diff Detail

Event Timeline

gilr created this revision.Mar 18 2020, 10:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 18 2020, 10:28 AM
gilr updated this revision to Diff 251161.Mar 18 2020, 1:34 PM

Clang format.

fhahn added inline comments.Mar 24 2020, 2:38 AM
llvm/lib/Transforms/Vectorize/VPlan.h
1069

I think it might be good to document what operands User has for loads & stores with and w/o masking.

1112

Do we need the extra IsMasked operand? Would it be sufficient to check the number of operands and use Load with 2 ops => has as mask, Store with 3 ops => has a mask?

gilr marked 2 inline comments as done.Mar 24 2020, 9:27 AM
gilr added inline comments.
llvm/lib/Transforms/Vectorize/VPlan.h
1112

Right, will replace it with a method.

gilr updated this revision to Diff 252351.Mar 24 2020, 9:28 AM

Addressed comments.

fhahn accepted this revision.Mar 24 2020, 9:47 AM

LGTM, thanks! Please wait a day or so with committing, in case there are other comments.

This revision is now accepted and ready to land.Mar 24 2020, 9:47 AM
gilr added a comment.Mar 24 2020, 10:20 AM

LGTM, thanks! Please wait a day or so with committing, in case there are other comments.

Will do. Thanks, Florian!

Ayal added a comment.Mar 24 2020, 10:56 AM

This looks good to me too, thanks, with minor nit.

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
6815
gilr marked an inline comment as done.Mar 25 2020, 12:27 AM
gilr updated this revision to Diff 252511.Mar 25 2020, 12:34 AM

Addressed comments.

This revision was automatically updated to reflect the committed changes.