[PATCH] D78992: [CodeGen] Add support for inserting elements into scalable vectors

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 28 04:15:36 PDT 2020


david-arm created this revision.
david-arm added reviewers: c-rhodes, sdesmalen.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

This patch tries to ensure that we do something sensible when
generating code for the ISD::INSERT_VECTOR_ELT DAG node when operating
on scalable vectors. Previously we always returned 'undef' when
inserting an element into an out-of-bounds lane index, whereas now
we only do this for fixed length vectors. For scalable vectors it
is assumed that the backend will do the right thing in the same way
that we have to deal with variable lane indices.

In this patch I have permitted a few basic combinations for scalable
vector types where it makes sense, but in general avoided most cases
for now as they currently require the use of BUILD_VECTOR nodes.

This patch includes tests for all scalable vector types when inserting
into lane 0, but I've only included one or two vector types for other
cases such as variable lane inserts.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D78992

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
  llvm/test/CodeGen/AArch64/sve-insert-element.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78992.260584.patch
Type: text/x-patch
Size: 12719 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200428/ccc2d95f/attachment.bin>


More information about the llvm-commits mailing list