OSDN Git Service

[AMDGPU] Custom lower INSERT_SUBVECTOR v3, v4, v5, v8
authorTim Renouf <tpr.llvm@botech.co.uk>
Thu, 4 Jul 2019 17:38:24 +0000 (17:38 +0000)
committerTim Renouf <tpr.llvm@botech.co.uk>
Thu, 4 Jul 2019 17:38:24 +0000 (17:38 +0000)
commit44e42cf0f2d44debdd79ad338185ff7d40534011
treeda1fa879523a34ceb41db0a5d2eebea7fef2dd3c
parentad6324c46bfbe08f6e3db74e44850cc83a962b68
[AMDGPU] Custom lower INSERT_SUBVECTOR v3, v4, v5, v8

Summary:
Since the changes to introduce vec3 and vec5, INSERT_VECTOR for these
sizes has been marked "expand", which made LegalizeDAG lower it to loads
and stores via a stack slot. The code got optimized a bit later, but the
now-unused stack slot was never deleted.

This commit avoids that problem by custom lowering INSERT_SUBVECTOR into
an EXTRACT_VECTOR_ELT and INSERT_VECTOR_ELT for each element in the
subvector to insert.

V2: Addressed review comments re test.

Differential Revision: https://reviews.llvm.org/D63160

Change-Id: I9e3c13e36f68cfa3431bb9814851cc1f673274e1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365148 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIISelLowering.cpp
lib/Target/AMDGPU/SIISelLowering.h
test/CodeGen/AMDGPU/insert-subvector-unused-scratch.ll [new file with mode: 0644]