[PATCH] D80208: [CodeGen] Add support for extracting elements of scalable vectors

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 22 11:15:32 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:5431
+    // returns a vector type that is guaranteed to only have one element,
+    // which is the case for fixed width vectors.
     if (N1.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
----------------
This comment doesn't seem quite right.

For fixed-width vectors, we only do this for vectors with exactly one element, but that's not because it's semantically incorrect for vectors with more than one element. It's easy to convert indexing on a subvector to indexing on the original vector.  The issue is just that it would make legalization more complex: we don't want to do the transform for vectors with more than one element without a profitability check.


================
Comment at: llvm/test/CodeGen/AArch64/sve-extract-element.ll:171
+; CHECK-NEXT:    mov w8, #9
+; CHECK-NEXT:    whilels p0.d, #0, x8
+; CHECK-NEXT:    lastb d0, p0, z0.d
----------------
This doesn't assemble.  (I assume you meant to refer to xzr?)


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

https://reviews.llvm.org/D80208





More information about the llvm-commits mailing list