[PATCH] D133473: [WebAssembly] Improve codegen for shuffles with undefined lane indices

Petr Penzin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 8 16:56:48 PDT 2022


penzn added a comment.

To me this makes since this applies to undefined indices and should not make any difference in case of valid ones.



================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:2325
     for (size_t J = 0; J < LaneBytes; ++J) {
-      // Lower undefs (represented by -1 in mask) to zero
-      uint64_t ByteIndex = M == -1 ? 0 : (uint64_t)M * LaneBytes + J;
+      // Lower undefs (represented by -1 in mask) to {0..J}, to allow further
+      // reduction at VM, eg. to dword shuffle.
----------------
Nit: maybe expand on why '{0..J}', it might be not immediately obvious for those who didn't look at shuffles recently.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133473



More information about the llvm-commits mailing list