[PATCH] D46827: [VPlan] Add VPInstruction to VPRecipe transformation.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 12:08:18 PDT 2018


fhahn added a comment.

In https://reviews.llvm.org/D46827#1121357, @dcaballe wrote:

> Thanks for this new version, Florian! Pretty excited to see that some inner loop tests are passing!
>  Satish is working on the support for outer loops in CG and we’ve been discussing your changes. We have to make sure that this patch aligns well with his next patch and also with the constraints that we stablished for this patch series and subsequent ones. Some comments in this regard:
>
> 1. We think that `VPInstructionsToVPRecipes` is still too smart for the vplan native path and bringing too much code (from CM and Legal, for example) an recipes that we would prefer to keep away from the native path until they are properly ported. Otherwise, we’d end up having the same development limitations as we have in the inner loop path. What we had in main for the Recipe to VPInstruction transition in the native path is something as simple as the code in https://reviews.llvm.org/D44338?vs=on&id=140081&whitespace=ignore-most, where `createRecipesForVPBB` is naively creating only `VPWidenMemoryInstructionRecipe`, `VPWidenRecipe` and `VPWidenPHIRecipe`. Satish will give you more details in this regard so that this patch aligns with his.


Sure, we can start with just creating the basic recipes.  Should we only support widening for a start and not relying on the cost model at all? I suppose that would make things easier for outer loop code gen.

> 
> 
> 2. An example of #1 is `createBlockInMask` and `createEdgeMask`, which are currently invoked from tryToWidenMemory. In the VPlan native path we are only supporting uniform control flow so no masking is necessary at this point. For divergence control flow we plan to introduce a VPlan based predication algorithm in patch series #2 which will conflict with code.
> 3. If you agree with the suggestion in #1, I think it would be better to introduce the inner loop support in the VPlan native path in a separate patch. In that way, we would introduce: a) VPInstructionToVPRecipe, b) CG support (Satish) and, finally, c) Basic inner loop support, i.e., same constraints as for outer loops, same naïve approach as in a) and b) and making sure that support for both inner and outer loops are well aligned.

Yep that sounds good. I would prefer not to land this change as dead code and if inner loop support is not pending on CG for outer loops, it would be great if we could get it in independently from that. Of course make sure it fits well with CG for outer loops.

> Of course, we also need to work to bring whatever is necessary for SLP-aware loop vectorization. We can have this discussion offline to better understand what would be missing in the VPlan native path.

I think to start with, the limited set of recipes is more than enough. Once we have inner loop support I shared an updated set of patches for SLP.

Thanks for your comments! Please let me know what you require for outer loop CG and when you are planning on sharing those patches, so I do not end up doing unnecessary work :)


https://reviews.llvm.org/D46827





More information about the llvm-commits mailing list