[llvm] [AMDGPU][LowerModuleLDS] Handle non-dynlds zero sized type (PR #84742)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 08:33:35 PDT 2024
================
@@ -1398,8 +1398,8 @@ class AMDGPULowerModuleLDS {
LDSVarsToTransform.begin(), LDSVarsToTransform.end()));
for (GlobalVariable *GV : Sorted) {
- OptimizedStructLayoutField F(GV,
- DL.getTypeAllocSize(GV->getValueType()),
+ unsigned Size = DL.getTypeAllocSize(GV->getValueType());
+ OptimizedStructLayoutField F(GV, Size ? Size : 1,
----------------
arsenm wrote:
I think the correct solution is to not add it to the layout, and just track there was this unknown size object. All the 0 sized objects are supposed to receive the same address (which we would want at the end of the known allocation)
https://github.com/llvm/llvm-project/pull/84742
More information about the llvm-commits
mailing list