[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 13:17:29 PST 2022


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:111
 #endif
 
+VPRecipeBase *VPValue::getDef() { return cast_or_null<VPRecipeBase>(Def); }
----------------
Ayal wrote:
> Documentation?
added in the header, thanks


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:112
 
+VPRecipeBase *VPValue::getDef() { return cast_or_null<VPRecipeBase>(Def); }
+const VPRecipeBase *VPValue::getDef() const {
----------------
Ayal wrote:
> Empty line separator?
done, thanks!


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:1177
   /// Returns the backedge value as a recipe. The backedge value is guaranteed
   /// to be a recipe.
+  VPRecipeBase *getBackedgeRecipe() { return getBackedgeValue()->getDef(); }
----------------
Ayal wrote:
> Rephrase comment and/or return a reference?
updated to return a reference


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136068



More information about the llvm-commits mailing list