[PATCH] D87842: [SVE] Use NEON for extract_vector_elt when the index is in range.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 13:39:38 PDT 2020


efriedma added a comment.

Please make sure we have test coverage for the SVE-only extracts (e.g. extracting the third element of a `<vscale x 2 x i64>`).



================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:9074
+    return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, Op.getValueType(),
+                       Bottom128, Op.getOperand(1));
+  }
----------------
paulwalker-arm wrote:
> efriedma wrote:
> > Is there some reason to do this as custom lowering, as opposed to just writing this directly as an iel pattern?
> I just figured it was better to reuse the existing patterns?
The EXTRACT_SUBVECTOR doesn't really have any semantic meaning here: it's just to model the fact that the underlying instructions are "NEON" instructions.  From a DAGCombine perspective, that isn't really useful information.  Given that, I'd lean towards adding more patterns, even if they're sort of redundant.  That said, the current approach is okay, I guess.

Is there any reason to prefer NEON extract instructions over SVE ones if we're producing a floating-point value?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87842



More information about the llvm-commits mailing list