[PATCH] D72324: [LV] Still vectorise when tail-folding can't find a primary inducation variable

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 00:41:39 PST 2020


samparker added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7525
+  // vectorised with a scalar epilogue.
+  if (!LVL->getPrimaryInduction())
+    return CM_ScalarEpilogueAllowed;
----------------
The ordering of the predicates tests seems to be a bit off from a readability point-of-view. If we're only thinking about predication, I would expect an early return if PredicateOptDisabled, which would also include Hints.getPredicate() == LoopVectorizeHints::FK_Disable. The last piece of logic would then only contain all the values that we require to enable the folding.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7652
     getScalarEpilogueLowering(F, L, Hints, PSI, BFI, TTI, TLI, AC, LI,
-                              PSE.getSE(), DT, LVL.getLAI());
+                              PSE.getSE(), DT, &LVL);
 
----------------
nit: why not just pass as reference?


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

https://reviews.llvm.org/D72324





More information about the llvm-commits mailing list