[PATCH] D121618: [LV] Move code to place pointer induction increment to VPlan post-processing.
Ayal Zaks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 20 16:02:50 PDT 2022
Ayal added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9592
// A pointer induction, performed by using a gep
- BasicBlock *LoopLatch =
- State.LI->getLoopFor(State.CFG.PrevBB)->getLoopLatch();
-
- const DataLayout &DL = LoopLatch->getModule()->getDataLayout();
- Instruction *InductionLoc = LoopLatch->getTerminator();
+ const DataLayout &DL = Phi->getModule()->getDataLayout();
const SCEV *ScalarStep = IndDesc.getStep();
----------------
nit: set Instruction *InductionLoc = &*State.Builder.GetInsertPoint() ?
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9604
+ &*State.Builder.GetInsertPoint());
+ NewPointerPhi->addIncoming(InductionGEP, State.CFG.VectorPreHeader);
----------------
Deserves a comment that this is temporary?
================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:986
// Skip phi-like recipes that generate their backedege values themselves.
// TODO: Model their backedge values explicitly.
+ if (isa<VPWidenPHIRecipe>(&R))
----------------
Above TODO is obsolete?
================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:995
+ if (all_of(WidenPhi->users(), [WidenPhi](const VPUser *U) {
+ return cast<VPRecipeBase>(U)->usesScalars(WidenPhi);
+ }))
----------------
An induction phi feeding only scalar users deserves a separate, non-'Widen', VP[Replicate]PointerInductionRecipe ?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121618/new/
https://reviews.llvm.org/D121618
More information about the llvm-commits
mailing list