AMDGPU: Add assert for GDS globals

This commit is contained in:
Matt Arsenault 2022-04-19 22:26:26 -04:00
parent af21445ea8
commit 1900b6c77b
1 changed files with 3 additions and 0 deletions

View File

@ -68,6 +68,9 @@ unsigned AMDGPUMachineFunction::allocateLDSGlobal(const DataLayout &DL,
// memory.
LDSSize = alignTo(StaticLDSSize, DynLDSAlign);
} else {
assert(GV.getAddressSpace() == AMDGPUAS::REGION_ADDRESS &&
"expected region address space");
Offset = StaticGDSSize = alignTo(StaticGDSSize, Alignment);
StaticGDSSize += DL.getTypeAllocSize(GV.getValueType());