[PATCH] D128342: [LoopVectorize] Disable tail-folding when masked interleaved accesses are unavailable

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 01:52:28 PDT 2022


sdesmalen added inline comments.


================
Comment at: llvm/include/llvm/Analysis/VectorUtils.h:814
 
+  bool haveGroups() const { return !InterleaveGroups.empty(); }
+
----------------
nit: s/haveGroups/hasGroups/ ?


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:5074
+    // on an unpredicated vector loop + scalar epilogue then let's do it now.
+    if (UserVF.isZero() &&
+        ScalarEpilogueStatus == CM_ScalarEpilogueNotNeededUsePredicate) {
----------------
I'm not sure I understand where the `UserVF` comes into play with this choice, given that this a choice between "tail folding" vs "scalar epilogue". Can you elaborate?


================
Comment at: llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding-interleave.ll:1
+; RUN: opt -loop-vectorize -S -prefer-predicate-over-epilogue=predicate-else-scalar-epilogue \
+; RUN:   -debug < %s 2>%t | FileCheck %s
----------------
Why is this loop still vectorized with a VF of 8?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128342



More information about the llvm-commits mailing list