[PATCH] D142589: [LV] Perform recurrence sinking directly on VPlan.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 01:26:57 PST 2023


Ayal added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:607
+  // processed first.
+  sort(RecipesToSink, [&VPDT](const VPRecipeBase *A, const VPRecipeBase *B) {
+    auto *RegionA = GetReplicateRegion(const_cast<VPRecipeBase *>(A));
----------------
Ayal wrote:
> fhahn wrote:
> > Ayal wrote:
> > > Recipes to sink are already held in a set: can `Seen` be set to use this order and serve as RecipesToSink?
> > SmallPtrSet and SetVector cannot be sorted unfortunately. Updated to use WorkList.
> Thought was to use some other set with "compare" set to dominance order (std::set? Admittedly not SmallPtrSet) to indicate which candidates were already seen and to later traverse them in the desired order.
As in SLPVectorizer.cpp's `std::set<ScheduleData *, ScheduleDataCompare> ReadyInsts;`, thereby saving the need to explicitly sort WorkList below. Best confirm that it works on Windows too...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142589



More information about the llvm-commits mailing list