[AMDGPU] Increase alignment of LDS globals if necessary before LDS lowering.
authorhsmahesha <mahesha.comp@gmail.com>
Fri, 4 Jun 2021 04:04:37 +0000 (09:34 +0530)
committerhsmahesha <mahesha.comp@gmail.com>
Fri, 4 Jun 2021 04:04:37 +0000 (09:34 +0530)
commitd71ff907ef23eaef86ad66ba2d711e4986cd6cb2
tree294bd468bc324024e258c746ec47f780a0ac6ac8
parent738abfdbea21acd2597d83ad3390daf5696b6d07
[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]