[PATCH] D88380: [VPlan] Extend VPValue to also model sub- & 'virtual' values.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 09:16:51 PDT 2020


fhahn created this revision.
fhahn added reviewers: Ayal, rengolin, gilr.
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 extends VPValue to model 3 different kinds of VPValues:

1. Concrete VPValues Concrete VPValues are either live-ins coming from IR or instructions/ recipes in VPlan which produce a single value. They are the most common kind.
2. Sub VPValues Sub-VPValues are result values from instructions/recipes in VPlan that produce multiple values. They contain a reference to the producing 'virtual' VPValue.
3. Virtual VPValues Virtual VPValues are used to model instructions/recipes that either produce multiple subvalues or no values at all. A virtual VPValue does not refer to a concrete value, which means it cannot be used like concrete or subvalues. For example, they cannot be used as operands. They can be used to traverse the def-use chains upwards. They also provide convenient access to all users of all sub-values of the producer.

Most existing recipes will be concrete VPValues (e.g. VPInstruction,
VPWidenRecipe & so on).Sub-VPValues can be used to model multiple result
values for VPInterleaveRecipe. VPInterleaveRecipe itself is a  'virtual'
VPValue, which allows for convenient traversal of the def-use chains.

The main advantage of handling everything in a VPValue over introducing
a new sub-class for sub-values (D87752 <https://reviews.llvm.org/D87752>) is that it slightly simplifies
things further down the road, by turning VPRecipeBase itself directly
into a VPValue. This simplifies things, by removing the duplicated
VPRecipeBaseID.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88380

Files:
  llvm/docs/Proposals/VectorizationPlan.rst
  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: D88380.294555.patch
Type: text/x-patch
Size: 11437 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200927/18fe037d/attachment.bin>


More information about the llvm-commits mailing list