[PATCH] D117743: [RISCV] Optimize vector_shuffles that are interleaving the lowest elements of two vectors.

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 20 08:50:09 PST 2022


rogfer01 accepted this revision.
rogfer01 added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:2348
+    // Ensure we consistenly use the source for this polarity.
+    int Src = Mask[i] / Size;
+    if (Srcs[Pol] < 0)
----------------
I admit was very confused by this because I assumed the `Mask` of the `SDNode` would be the operand of the IR more or less verbatim (e.g. `0, 2, 1, 3`), but apparently it seems it is adjusted by the length of the mask itself (i.e. the elements of the second source are offset by the length of the concatenated vector, not sure if my interpretation is correct after reading the SelectionDAG code though).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117743



More information about the llvm-commits mailing list