[AMDGPU] Fix PromoteAlloca Subvector Stores for Single Elements
authorpvanhout <pierre.vanhoutryve@amd.com>
Wed, 26 Jul 2023 10:26:13 +0000 (12:26 +0200)
committerTobias Hieta <tobias@hieta.se>
Fri, 28 Jul 2023 07:07:50 +0000 (09:07 +0200)
commit66145712c823a5cce91bc3b7a655a59edd1a57da
tree698bb0e4403c6ffdddbfd26ce3689ab2cd85f433
parentb56a38f3967fcad449dd78484617690924362819
[AMDGPU] Fix PromoteAlloca Subvector Stores for Single Elements

The previous condition was incorrect in some cases, like storing <2 x i32>
into a double. If IndexVal was >0, we ended up never storing anything.

Reviewed By: #amdgpu, arsenm

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

(cherry picked from commit a8aabba5872aeaa57fbc71fdfde025d70d11deb0)
llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
llvm/test/CodeGen/AMDGPU/promote-alloca-subvecs.ll