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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 07:53:03 PDT 2023


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:
> 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.


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