[PATCH] D87752: [VPlan] Add VPMultiValue.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 02:41:38 PDT 2020


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

This patch adds a new VPMultiValue, which can be used to wrap a VPValue
from a producer that produces multiple values, like VPInterleaveRecipe,
which produces a value for each member in an interleave group.

Note that it would also be possible to model the results as sub-values
by creating concatenating all results and extracting the relevant parts.
However, this would mean that we need to create values that might not be
used in the end and make analysis more complicated than necessary.

This patch adds the notion of a 'defining value', which is the actual
instance producing the (multi) value. The defining value for regular
VPValues is the VPValue itself. VPMultiValues keep track of their
defining value. Currently the defining value is a VPValue to keep things
simple. In practice this means the producer of a multi-value needs to
inherit from VPValue itself. This VPValue should not be referenced by
any other VPValues and only acts as convenient way to access all users
of all VPMultiValues by the same defining value.

With this scheme, it is possible to traverse the def-use chains as
follows:

1. To walk upwards given a VP(Multi)Value, use `getDefiningValue` to get the producer. Use the operands of the producer to continue the walk upwards.

2. To walk downwards, just iterate over all users of the producer. This can be done by iterating over all users of all VPMultiValues of the producer. Given that the producer is a VPValue itself, all users of the individual VPMultiValues are added as users of the producer.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87752

Files:
  llvm/lib/Transforms/Vectorize/VPlanValue.h
  llvm/unittests/Transforms/Vectorize/VPlanTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87752.292159.patch
Type: text/x-patch
Size: 4607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200916/f7c9da2b/attachment.bin>


More information about the llvm-commits mailing list