[PATCH] D118167: [VPlan] Record whether scalar IVs are need in induction recipe. (NFC)

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 08:12:23 PST 2022


Ayal added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:2588
   // true if the induction variable itself is not widened, or if it has at
   // least one user in the loop that is not widened.
+  if (Def->needsVectorIV() && !Def->needsScalarIV()) {
----------------
While we're here, comment above is out of sync with code below.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8606
+    return new VPWidenIntOrFpInductionRecipe(
+        Phi, Start, II, I, NeedsScalarIV, !NeedsScalarIV || !NeedsScalarIVOnly);
   }
----------------
`!NeedsScalarIV || !NeedsScalarIVOnly` - suffice to have only `!NeedsScalarIVOnly` to feed `NeedsVectorIV` ?

Refactor the code that constructs a VPWidenIntOrFpInductionRecipe to be used by both tryToOptimizeInduction[PHI,Truncate]?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118167



More information about the llvm-commits mailing list