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

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 09:43:51 PDT 2020


paulwalker-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:9074
+    return DAG.getNode(ISD::EXTRACT_VECTOR_ELT, DL, Op.getValueType(),
+                       Bottom128, Op.getOperand(1));
+  }
----------------
efriedma wrote:
> 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?
> Is there any reason to prefer NEON extract instructions over SVE ones if we're producing a floating-point value?

I was thinking about it the other way round, namely why would we prefer SVE over NEON? This was based on an assumption that a NEON extract might be cheaper than a full register SVE dup.  At this stage though I'm happy to wait for proof one way or the other, so have just omitted the floating-point patterns for this patch.


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