================ @@ -1123,9 +1123,7 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, if (!CurFnInfo->getReturnInfo().getIndirectByVal()) { ReturnValuePointer = CreateDefaultAlignTempAlloca(Int8PtrTy, "result.ptr"); - Builder.CreateStore(Builder.CreatePointerBitCastOrAddrSpaceCast( - ReturnValue.getPointer(), Int8PtrTy), - ReturnValuePointer); + Builder.CreateStore(ReturnValue.getPointer(), ReturnValuePointer); ---------------- bjope wrote:
So `ReturnValue.getPointer()` is guaranteed to be an unqualified pointer? I'm just wondering why this hasn't been just a pointer bitcast in the past. But even if it would cast away an address space it seems a bit weird. Not sure if it is worth an assert now when we bypass all the castIsValid checks etc that would have been done in the past. (And maybe the "result.ptr" should be created with `ReturnValue.getPointer().getType()` rather than using Int8PtrTy. Although I consider that as out of scope for this patch.) https://github.com/llvm/llvm-project/pull/68277 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits