]> granicus.if.org Git - llvm/commit
[AMDGPU] Fix for vector element insertion
authorTim Corringham <tcorring@amd.com>
Fri, 1 Feb 2019 16:51:09 +0000 (16:51 +0000)
committerTim Corringham <tcorring@amd.com>
Fri, 1 Feb 2019 16:51:09 +0000 (16:51 +0000)
commit3e0069dcb626a75e3d671443b31ccf15de0b6528
treeff619f802b19d3b6185f8d7e609ee6883b0a374c
parent3ebe457432b225d8446508422ca19ddf3cba4932
[AMDGPU] Fix for vector element insertion

Summary:
Incorrect code was generated when lowering insertelement operations
for vectors with 8 or 16 bit elements.  The value being inserted was
not adjusted for the position of the element within the 32 bit word
and so only the low element within each 32 bit word could receive
the intended value.

Fixed by simply replicating the value to each element of a
congruent vector before the mask and or operation used to
update the intended element.

A number of affected LIT tests have been updated appropriately.

before the mask & or into the intended

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm

Subscribers: llvm-commits, arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352885 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIISelLowering.cpp
test/CodeGen/AMDGPU/fcanonicalize-elimination.ll
test/CodeGen/AMDGPU/insert_vector_dynelt.ll
test/CodeGen/AMDGPU/insert_vector_elt.ll
test/CodeGen/AMDGPU/insert_vector_elt.v2i16.ll
test/CodeGen/AMDGPU/insert_vector_elt.v2i16.subtest-nosaddr.ll
test/CodeGen/AMDGPU/insert_vector_elt.v2i16.subtest-saddr.ll