[PATCH] D92312: [IR] Disallow scalable vectors in ShuffleVectorInst::isExtractSubvectorMask

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 07:43:33 PST 2020


david-arm added inline comments.


================
Comment at: llvm/include/llvm/IR/Instructions.h:2271
+    assert(isa<FixedVectorType>(Mask->getType()) &&
+           "Shuffle needs vector constant.");
     SmallVector<int, 16> MaskAsInts;
----------------
Is it worth updating the text in the assert, i.e. "Shuffle needs fixed width vector constant"?


================
Comment at: llvm/include/llvm/IR/Instructions.h:2281
+    // case.
+    if (isa<ScalableVectorType>(getType()))
+      return false;
----------------
To be honest, it feels a bit inconsistent that in one variant of the function we assert it's a FixedVectorType, but we permit it in the other. Is it worth making both variants assert we're dealing with a FixedVectorType and changing the callsites to only call for FixedVectorTypes? It looks like we only these functions called from two places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92312



More information about the llvm-commits mailing list