[llvm] 1900b6c - AMDGPU: Add assert for GDS globals
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 19:41:06 PDT 2022
Author: Matt Arsenault
Date: 2022-04-19T22:28:11-04:00
New Revision: 1900b6c77b9263239964817d56990cd84cb56729
URL: https://github.com/llvm/llvm-project/commit/1900b6c77b9263239964817d56990cd84cb56729
DIFF: https://github.com/llvm/llvm-project/commit/1900b6c77b9263239964817d56990cd84cb56729.diff
LOG: AMDGPU: Add assert for GDS globals
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
index 9903c639f8c70..18f61df7ed882 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp
@@ -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());
More information about the llvm-commits
mailing list