[PATCH] D147567: [VPlan] Only create extracts for recurrence exits if there are live-outs.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 15:44:11 PDT 2023


Ayal added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3903
+    for (VPLiveOut *LiveOut : LiveOuts) {
+      assert(!Cost->requiresScalarEpilogue(VF));
+      PHINode *LCSSAPhi = LiveOut->getPhi();
----------------
post-commit nit: better assert once, early - inside if (!LiveOuts.empty())?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3837
   Value *Incoming = State.get(PreviousDef, UF - 1);
   auto *ExtractForScalar = Incoming;
   auto *IdxTy = Builder.getInt32Ty();
----------------
fhahn wrote:
> fhahn wrote:
> > Ayal wrote:
> > > nit: define ExtractForScalar closer to its use below?
> > > 
> > > Set insert point, and possibly RuntimeVF, early for both Extract's.
> > Will do separately.
> Should be done in f9d0b35d2238
> nit: define ExtractForScalar closer to its use below?

post-commit: the method currently defines ExtractForScalar, then defines and uses ExtractForPhiUsedOutsideLoop, and finally uses ExtractForScalar. Better fully handle scalar loop Phi and Start first, and then take care of exit block live-outs - potentially early-exiting if there are no live-outs? May need to reset Builder again.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147567



More information about the llvm-commits mailing list