[PATCH] D99750: [LV, VP]VP intrinsics support for the Loop Vectorizer

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 12:53:18 PST 2023


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp:1743
+  PHINode *EntryPart =
+      State.Builder.CreatePHI(Start->getType(), 2, "evl.based.iv");
+  EntryPart->addIncoming(Start, VectorPH);
----------------
ABataev wrote:
> fhahn wrote:
> > ABataev wrote:
> > > shiva0217 wrote:
> > > > There is a case that the PHI didnt' been inserted at top of basic block.
> > > > 
> > > >     int foo (int value, int *buf, int *end) {
> > > >       int *tmp;
> > > >       for (tmp = buf; tmp < end; tmp++)
> > > >         value -= *tmp;
> > > >       return value;
> > > >     }
> > > > 
> > > > Should we specify insertion point?
> > > > Something like:
> > > > 
> > > >     PHINode *EntryPart = PHINode::Create(
> > > >         Start->getType(), 2, "evl.based.iv", &*State.CFG.PrevBB->getFirstInsertionPt());
> > > Fixed in VPlanTransforms.cpp by inserting the recipe immediately after CanonicalIVPHI.
> > I think `VPEVLBasedIVPHIRecipe` should be turned into a subclass of VPHeaderPHIRecipe, this will also ensure that the VPlan verifier checks it is in the header section
> You mean it should be dervied from VPEVLBasedIVPHIRecipe? Already done.
Great!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99750



More information about the llvm-commits mailing list