This is not ready for review yet. At the very least, it will not do anything properly without adjusting the cost model for the adjusted vplan (it will currently just use the sum of the costs for the instructions in the original loop). It is probably several commits in one.
It is meant mostly as an illustration to show different ways of vplan working, between multiple inheritance and inheriting through VPRecipeBase. It sits on top of the patches linked to D84679, but is still in a very rough state.
The patch:
- Adds a adjustVPlanForVectorPatterns to transform VPlans to other vector patterns.
- Adds tryCombineToMulh to match trunc(lsr(mul(ext, ext)), BW)) and convert it to a VPInstruction::vmulh node in the vplan graph.
- It adds some simple vp_ pattern matchers.
In order to do this it makes the various VPRecipe's inherit from VPUser, VPValue and VPRecipe (where needed), as is done in D84679. It adds the extra casting logic needed, but I believe recursivelyDeleteUnusedRecipes does not work here (but probably could be made to with some extra love).