================
@@ -433,12 +435,15 @@ CIRGenModule::getOrCreateStaticVarDecl(const VarDecl &d,
mlir::Type lty = getTypes().convertTypeForMem(ty);
assert(!cir::MissingFeatures::addressSpace());
- if (d.hasAttr<LoaderUninitializedAttr>() || d.hasAttr<CUDASharedAttr>())
+ mlir::Attribute init = nullptr;
+ if (d.hasAttr<LoaderUninitializedAttr>())
errorNYI(d.getSourceRange(),
"getOrCreateStaticVarDecl: LoaderUninitializedAttr");
- assert(!cir::MissingFeatures::addressSpace());
+ else if (ty.getAddressSpace() != LangAS::opencl_local &&
+ !d.hasAttr<CUDASharedAttr>())
+ init = builder.getZeroInitAttr(convertType(ty));
- mlir::Attribute init = builder.getZeroInitAttr(convertType(ty));
+ assert(!cir::MissingFeatures::addressSpace());
----------------
ZakyHermawan wrote:
createVersionedGlobal did not requrie AddressSpace as argument.
Do the assert statement still necessary ?
https://github.com/llvm/llvm-project/pull/184248
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits