[llvm] [AMDGPU][LowerModuleLDS] Handle non-dynlds zero sized type (PR #84742)
Pierre van Houtryve via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 11 07:27:04 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,
----------------
Pierre-vh wrote:
I think it'd be for a variable length array. It's why we lower as dynlds for external ones. I assume we just can't lower them then and we should probably just fatal_error. It's a bit ugly to fatal in the backend but better than asserting
https://github.com/llvm/llvm-project/pull/84742
More information about the llvm-commits
mailing list