[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 03:57:07 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:

What is the meaning of a 0 size allocation? Can we just not add it to LayoutFields instead of wasting a byte?

https://github.com/llvm/llvm-project/pull/84742


More information about the llvm-commits mailing list