[PATCH] D88152: [VPlan][WIP] VMULH via VPRecipeBase

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 07:59:22 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 VPRecipeBase inherit from VPUser, which in turn inherits from VPValue. This means that all recipes are vpvalues (whether they are used or not), and it is easy to find walk up and down def-use chains. VPRecipeBase::SubclassID is removed as it becomes subsumed by VPValue::SubclassID.

It passes the llvm lit tests, but I have run no further testing on it.


https://reviews.llvm.org/D88152

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
  llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88152.293726.patch
Type: text/x-patch
Size: 57777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200923/03b237b4/attachment.bin>


More information about the llvm-commits mailing list