================
@@ -43,6 +44,29 @@ bool tryExtendLLVMBitcodeMarker(GlobalVariable &Bitcode) {
return true;
}
+bool tryExtendDynamicLDSGlobal(GlobalVariable &GV) {
+ constexpr unsigned WorkgroupAS = 3;
+ const bool IsWorkgroupExternal =
+ GV.hasExternalLinkage() && GV.getAddressSpace() == WorkgroupAS;
+ if (!IsWorkgroupExternal)
+ return false;
+
+ const ArrayType *AT = dyn_cast<ArrayType>(GV.getValueType());
+ if (!AT || AT->getNumElements() != 0)
+ return false;
----------------
jmmartinez wrote:
Sorry I'm not sure I understood the question.
This condition is matching globals that have an array type with 0 elements. If
the global does not have an array type or if it is an array type with a size
different from 0 this function returns false.
Maybe there is a mix from using `getValueType` vs `getType`. The first gives
the type of the initializer of the global (the value stored in the global), the
second returns the type of the global when used as a value in the llvm-ir (a
pointer type).
https://github.com/llvm/llvm-project/pull/166952
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits