================
@@ -488,6 +488,18 @@ void CIRGenFunction::emitFunctionProlog(const
FunctionArgList &args,
convertType(paramVar->getType()), paramLoc, alignment,
/*insertIntoFnEntryBlock=*/true);
+ mlir::ptr::MemorySpaceAttrInterface srcAddrSpace =
+ getCIRAllocaAddressSpace();
+ mlir::ptr::MemorySpaceAttrInterface destAddrSpace =
+ cir::toCIRAddressSpaceAttr(getMLIRContext(),
+ paramVar->getType().getAddressSpace());
+ if (srcAddrSpace != destAddrSpace) {
+ mlir::Type destPtrTy = builder.getPointerTo(
+ (cast<cir::PointerType>(addrVal.getType())).getPointee(),
+ destAddrSpace);
+ addrVal = performAddrSpaceCast(addrVal, destPtrTy);
+ }
----------------
Fznamznon wrote:
Sure, why not
https://github.com/llvm/llvm-project/pull/220836
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits