[PATCH] D38676: [LV] Model masking in VPlan, introducing VPInstructions

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 15 08:40:56 PDT 2017


rengolin added a comment.

In https://reviews.llvm.org/D38676#897413, @gilr wrote:

> To avoid introducing dead code into LV we're adding the new VPlan constructs along with a single, well-bounded use case.


Earlier patches in a patch series are not considered dead code. If you submit a 2-patch series, it'd make it easier for us to understand what's needed to create the infrastructure and what's its usage. As it is, it's hard to know what code movement is one or the other.

> Splitting the masking code in LoopVectorize.cpp is challenging: once VPlan takes care of the masks it must rewire them to the relevant Recipes (which are few).

This could be part of the first patch.

> Most of the changes/additions to the VPlan* files are rather simple and technical. The changes in LoopVectorize.cpp are the more complex part and deserve a more elaborate explanation, to be appended to the patch summary:

These could also be comments. There are a lot of comments in the vectoriser for that reason. :)

> - createBlockInMask(), createEdgeMask(): these two methods moved from ILV to the Planner. Their code is essentially unchanged, except they now generate VPValues instead of Values. They are now called by Planner and passed down to mask-aware Recipes during VPlan construction.

This looks like it's part of the first patch.

> - ILV::vectorizeMemoryInstruction() was so far called from VPWidenRecipe and generated the masks on-the-fly using createBlockInMask(). In this patch it is called by the new VPWidenMemoryInstructionRecipe, which provides the masks as an optional argument.
> - VPBlendRecipe takes over non-loop phi's. It generates the same sequence of selects, only based on VPlan masks.
> - VPBranchOnMaskRecipe now takes a VPValue mask.

These look like they're part of the second.

--renato


https://reviews.llvm.org/D38676





More information about the llvm-commits mailing list