Skip to content

Commit c4b2b8b

Browse files
committed
[Review] Add comment
1 parent b14f1e5 commit c4b2b8b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

llvm/lib/Target/SPIRV/SPIRVPrepareGlobals.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ bool tryExtendLLVMBitcodeMarker(GlobalVariable &Bitcode) {
4545
return true;
4646
}
4747

48+
// In HIP, dynamic LDS variables are represented using 0-element global arrays
49+
// in the __shared__ language address-space.
50+
//
51+
// extern __shared__ int LDS[];
52+
//
53+
// These are not representable in SPIRV directly.
54+
// To represent them, for AMD, we use an array with UINT32_MAX-elements.
55+
// These are reverse translated to 0-element arrays.
4856
bool tryExtendDynamicLDSGlobal(GlobalVariable &GV) {
4957
constexpr unsigned WorkgroupAS =
5058
storageClassToAddressSpace(SPIRV::StorageClass::Workgroup);

0 commit comments

Comments
 (0)