[PATCH] D100257: [VPlan] Add VPUserID to distinguish between recipes and others.

Gil Rapaport via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 10 04:03:15 PDT 2021


gilr added a comment.

> Thanks, I updated the code to turn VPUser in a virtual base class and added s subclass for the uses in VPBlockBase. WDYT?

Looks good!

> (For now I used a dummy function VPUser::makeVPUserVirtual to turn VPUser into a pure virtual class. Not sure if there's a different way?)

Wouldn't making the constructors protected suffice?



================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:685
+  static inline bool classof(const VPUser *U) {
+    return U->getVPUserID() == VPUser::VPUserID::Recipe;
+  }
----------------
a.elovikov wrote:
> fhahn wrote:
> > a.elovikov wrote:
> > > Can we make `getVPUserID()` protected instead of friendship above?
> > Unfortunately I don't think so. If it's protected, we can access it from inside a VPRecipeBase object, but here we need to access it from a `VPUser` pointer directly.
> I'd rather make the enum/method public then, but it's very subjective.
> I'd rather make the enum/method public then, but it's very subjective.

+1


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100257



More information about the llvm-commits mailing list