[PATCH] D158449: [IR]Add NumSrcElts param to is..Mask static function in ShuffleVectorInst.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 13:52:22 PDT 2023


ABataev added inline comments.


================
Comment at: llvm/lib/IR/Instructions.cpp:2366
       continue;
-    if (Mask[i] != (NumElts - 1 - i) && Mask[i] != (NumElts + NumElts - 1 - i))
+    if (Mask[I] != (NumSrcElts - 1 - I) &&
+        Mask[I] != (NumSrcElts + NumSrcElts - 1 - I))
----------------
craig.topper wrote:
> If Mask.size() == 4 and NumSrcElts == 6. Then this considers <5, 4, 3, 2> as a reverse?
Yes. Need to add a check that the operation does not change the size, just like non-static isReverse() does.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158449



More information about the llvm-commits mailing list