[PATCH] D95139: [SVE][LoopVectorize] Add support for extracting the last lane of a scalable vector

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 05:54:16 PST 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VPlan.h:102
+  enum NonConstantLanes {
+    LAST_LANE = 0xFFFFFFFF,
+    FIRST_NON_CONST_LANE = LAST_LANE,
----------------
For scalable vectors, it probably only ever makes sense to capture any of the following lanes:
* The first N lanes from <vscale x N x <eltty>>
* The last N lanes from <vscale x N x <eltty>>

I'm not sure if the loop-vectorizer would currently ever need more than just the first/last lane, but I could imagine for interleaving it may want to extract the second/third/fourth-last value from the vector.

Perhaps you can represent this with:
  unsigned LaneIdx;
  enum {
    LK_Fixed,
    LK_ScalableFirst,
    LK_ScalableLast,
  } LaneKind;
?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95139



More information about the llvm-commits mailing list