[PATCH] D78267: [InstCombine][SVE] Fix visitExtractElementInst for scalable type.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 15:38:05 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Analysis/VectorUtils.cpp:296
+    // FIXME: ShuffleVectorInstruction ShuffleMask need to handle scalable type.
+    if (!EC.Scalable || EltNo < LHSWidth) {
+      int InEl = SVI->getMaskValue(EltNo);
----------------
"EltNo < LHSWidth" doesn't make any sense.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp:339
     // InstSimplify should handle cases where the index is invalid.
-    if (!IndexC->getValue().ule(NumElts))
+    if (!IndexC->getValue().ult(NumElts))
       return nullptr;
----------------
I don't think it makes sense to ignore the "scalable" bit here; it's perfectly sensible to extract the third element from a `<vscale x 2 x i64>`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78267





More information about the llvm-commits mailing list