This patch adds a moveAfter method to VPRecipeBase, which can be used to
move elements after other elements, across VPBasicBlocks, if necessary.
It also adds an initial unittest for VPlan.
Thanks for the unittest, Florian! I will be very useful!
instruction -> recipe
I wonder if it would be better to start a VPInstructionUtils and move this utility there, similar to what I did with VPBlockUtils in D44338.
Just for my understanding, wouldn't it be possible to use getSublistAccess?
Thanks Diego. I think we should be able to use unit tests extensively for VPlan, as it should be quite lightweight to construct a VPlan, run a transformation and check the resulting VPlan.
I added it as member function here because there is a similar Instruction::moveAfter function. I think having a similar member function here makes it easier for people being used to the existing APIs.
Yes I guess we could use getSublistAccess, but I am not entirely sure what the use case of this function is? Its comment says it returns a pointer to a member of the recipe list, but then it ignores the parameter.
IMO it would be better, safer to return a reference (BasicBlock has a similar getInstList function). Maybe getRecipes should be renamed to getRecipeList and we could remove getSublistAccess, as it is not used anywhere?
Only minor comments! LGTM.
Ok, if that's the case for Instruction let's go with this.
Agreed. Yes, please, remove getSublistAccess and let's use getRecipeList.
delete all the new Instructions and VPInstruction will also be necessary here?