[PATCH] D147963: [LV] Use VPValue for SCEV expansion in fixupIVUsers.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 04:35:15 PDT 2023


fhahn marked an inline comment as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:3385
+  Value *Step = nullptr;
   for (User *U : OrigPhi->users()) {
     auto *UI = cast<Instruction>(U);
----------------
Ayal wrote:
> fhahn wrote:
> > Ayal wrote:
> > > Would it make sense to look for the IV recipe that corresponds to OrigPhi (with overridden getVPValue() or by scanning header phi recipes) and then reach its Step, instead of looking for StepR in preheader and relying on II.getStep()?
> > > (Traversing IV recipes (or live-outs) instead of original phi's could probably follow.)
> > Unfortunately we cannot rely on mapping IV recipes to `OrigPhi` here, as an original `VPWidenIntOrFpInductionRecipe` ( which maps to `OrigPhi`) could be transformed to a `VPScalarIVStepsRecipe`, which doesn't store `OrigPhi`. 
> > 
> > This will only be cleaned up once we completely model fixing up inductions in VPlan.
> ok, deserves a TODO note emphasizing it's a temporary solution.
> 
> Worth recording a SCEVtoExpandSCEVRecipe mapping in VPlan (with a note that it too is temporary)?
Updated the code to have a temporary mapping. I've not added a TODO, as moving IV fix up to VPlan is a general TODO :) 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147963



More information about the llvm-commits mailing list