[AMDGPU] Increase alignment of LDS globals if necessary before LDS lowering.
authorhsmahesha <mahesha.comp@gmail.com>
Mon, 7 Jun 2021 11:51:19 +0000 (17:21 +0530)
committerhsmahesha <mahesha.comp@gmail.com>
Mon, 7 Jun 2021 12:30:41 +0000 (18:00 +0530)
commit52ffbfdffc240085fc6ac39cff2f98e66458171f
tree01d3de9fedd53cc9e6d94ba11b0ad8270d7b199c
parent7736c1936a93d7effecf32ef5193dfc00b732cd2
[AMDGPU] Increase alignment of LDS globals if necessary before LDS lowering.

Before packing LDS globals into a sorted structure, make sure that
their alignment is properly updated based on their size. This will make
sure that the members of sorted structure are properly aligned, and
hence it will further reduce the probability of unaligned LDS access.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D103261
llvm/lib/Target/AMDGPU/AMDGPULowerModuleLDSPass.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/lds-global-value.ll
llvm/test/CodeGen/AMDGPU/ds_read2.ll
llvm/test/CodeGen/AMDGPU/ds_read2_offset_order.ll
llvm/test/CodeGen/AMDGPU/ds_write2.ll
llvm/test/CodeGen/AMDGPU/lds-alignment.ll
llvm/test/CodeGen/AMDGPU/promote-alloca-globals.ll
llvm/test/CodeGen/AMDGPU/update-lds-alignment.ll [new file with mode: 0644]