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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 29 04:31:19 PDT 2023


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





================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9650
           State.set(this, State.get(this, VPIteration(0, 0)),
                     VPIteration(Part, 0));
       }
----------------
Ayal wrote:
> 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.
I updated the patch to set the value for all parts for values defined outside of the loop; to catch this cases we would need to either hoist the load out of the loop or add way to check for values uniform across all parts/invariance, which could be done in the future based on VPlan.


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


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