[PATCH] D74445: [VPlan] Add ParentPlan pointer to VPBlockBase.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 1 14:19:00 PST 2020


fhahn updated this revision to Diff 247520.
fhahn added a comment.



In D74445#1899945 <https://reviews.llvm.org/D74445#1899945>, @gilr wrote:

> An alternative to adding a VPlan* to every VP block might be to reuse their existing Parent property by having (only) the topmost block's parent point to VPlan,  similar to the IR hierarchy where ancestors are reached indirectly through transitivity. This would require VPlan to inherit from VPRegion, which may deserve further discussion.
>  For now let's go ahead with the suggested VPlan pointer in VPBlockBase, but better just call it get/Plan instead of get/ParentPlan, saving parenthood's existing semantics.
>  Since the only current use case for this is debugging, we can simplify the patch and maintain a future trivial switch to the above by setting only the entry block's VPlan e.g. at VPlan::setEntry() and have getPlan() traverse upwards until reaching a topmost block and backwards until reaching the entry. This also better supports potential moving blocks in and out of VPlans.
>  Makes sense?


Sounds good to me. Updated the patch accordingly. I've used getParent() in order to find the top-most entry block.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74445/new/

https://reviews.llvm.org/D74445

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.cpp
  llvm/lib/Transforms/Vectorize/VPlan.h
  llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp
  llvm/unittests/Transforms/Vectorize/VPlanPredicatorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74445.247520.patch
Type: text/x-patch
Size: 4872 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200301/47b80e43/attachment.bin>


More information about the llvm-commits mailing list