[PATCH] D153696: [LV] Only generate 1st part outside of vector region for VPInstruction.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 08:15:23 PDT 2023


Ayal added a comment.

> Update VPInstruction::execute to only generate code for the first part
> if the recipe is outside the vector loop region (i.e. the pre-headers
> for now).

If a recipe should generate code for first part only, depends in general on its uniformity rather than it being placed inside or outside the vector loop region.

Simpler and more consistent to register uniform values across all parts when defined, rather than check their uniformity during retrieval when used?



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9650
           State.set(this, State.get(this, VPIteration(0, 0)),
                     VPIteration(Part, 0));
       }
----------------
If a recipe should generate one invariant/uniform-across-UF IR value across all parts, regardless of its position being inside or outside the vectorized loop, it can do so while registering it for all parts, as done here.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9863
+  VPRecipeBase *DefRecipe = Def->getDefiningRecipe();
+  if (DefRecipe && !DefRecipe->getParent()->getParent())
+    Part = 0;
----------------
Def->isDefinedOutsideVectorRegions()?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153696



More information about the llvm-commits mailing list