[PATCH] D125301: [LoopVectorize] Add option to use active lane mask for loop control flow

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 22:11:53 PDT 2022


fhahn accepted this revision.
fhahn added a comment.

LGTM, thanks! I left a few inline comments where some of the comments could still be update. Also it would be good to add to TODO to replace the phi recipe and do this as follow up soon.



================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:1515
 
+  bool useActiveLaneMaskForControlFlow() const {
+    return FoldTailByMasking &&
----------------
nit: would be good to add a quick comment here.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.cpp:596
   auto *Term = dyn_cast<VPInstruction>(&ExitingVPBB->back());
   // Try to simplify BranchOnCount to 'BranchOnCond true' if TC <= VF * UF when
   // preparing to execute the plan for the main vector loop.
----------------
nit: comment still needs updating?


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:1878
+/// used to predicate the vector operations.
+class VPActiveLaneMaskPHIRecipe : public VPHeaderPHIRecipe {
+  DebugLoc DL;
----------------
nit: TOOD/FIXME to replace this by the more general VPWidenPHIRecipe?


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

https://reviews.llvm.org/D125301



More information about the llvm-commits mailing list