[PATCH] D88153: [VPlan][WIP] VMULH via multiple inheritance

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 07:59:26 PDT 2020


dmgreen created this revision.
dmgreen added reviewers: fhahn, Ayal, gilr.
Herald added subscribers: llvm-commits, bmahjour, psnobl, rogfer01, bollu, hiraditya.
Herald added a reviewer: rengolin.
Herald added a project: LLVM.
dmgreen requested review of this revision.
Herald added a subscriber: vkmr.

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 <https://reviews.llvm.org/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 <https://reviews.llvm.org/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).


https://reviews.llvm.org/D88153

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.cpp
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/lib/Transforms/Vectorize/VPlanValue.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88153.293722.patch
Type: text/x-patch
Size: 56158 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200923/7d57974c/attachment.bin>


More information about the llvm-commits mailing list