[PATCH] D136068: [VPlan] Update VPValue::getDef to return VPRecipeBase* (NFC).

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 07:05:03 PST 2022


fhahn updated this revision to Diff 473655.
fhahn marked 3 inline comments as done.
fhahn added a comment.



In D136068#3877832 <https://reviews.llvm.org/D136068#3877832>, @Ayal wrote:

> A more accurate name for getDef() may then be getDefiningRecipe(), as in MLIR's Value::getDefiningOp().

Updated, thanks!

> Using cast_or_null() effectively implies that VPDef is a pure base-class having VPRecipeBase as its sole direct subclass. If this is (and will continue to be) the case, should VPDef's constructor be non-public, and VPDef be an internal subclass of VPRecipeBase rather than a base-class thereof? The original intention was for VPDef to be analogous to VPUser, but live-in's are represented with VPValue's having no VPDef whereas live-out's are represented with the VPLiveOut subclass of VPUser - sibling of VPRecipeBase.

Sounds good as a separate refactoring!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136068

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136068.473655.patch
Type: text/x-patch
Size: 12761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221107/f625aa0a/attachment.bin>


More information about the llvm-commits mailing list