[PATCH] D84874: [SVE][CodeGen] Legalisation of INSERT_VECTOR_ELT for scalable vectors

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 29 10:34:44 PDT 2020


kmclaughlin created this revision.
kmclaughlin added reviewers: sdesmalen, efriedma, david-arm.
Herald added subscribers: llvm-commits, psnobl, hiraditya, tschuett.
Herald added a project: LLVM.
kmclaughlin requested review of this revision.

When the result type of insertelement needs to be split,
SplitVecRes_INSERT_VECTOR_ELT will try to store the vector to a
stack temporary, store the element at the location of the stack
temporary plus the index, and reload the Lo/Hi parts.

This patch does the following to ensure this works for scalable vectors:

- Sets the StackID with getStackIDForScalableVectors() in CreateStackTemporary
- Adds an IsScalable flag to getMemBasePlusOffset() and scales the offset by VScale when this is true
- Ensures the immediate is clamped correctly by clampDynamicVectorIndex so that we don't try to use an out of range index


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84874

Files:
  llvm/include/llvm/CodeGen/SelectionDAG.h
  llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
  llvm/test/CodeGen/AArch64/sve-split-insert-elt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84874.281651.patch
Type: text/x-patch
Size: 14950 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200729/e24ecae9/attachment.bin>


More information about the llvm-commits mailing list