================ @@ -5390,11 +5391,19 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, V->getType()->isIntegerTy()) V = Builder.CreateZExt(V, ArgInfo.getCoerceToType()); - // If the argument doesn't match, perform a bitcast to coerce it. This - // can happen due to trivial type mismatches. + // If the argument doesn't match, we are either trying to pass an + // alloca-ed sret argument directly, and the alloca AS does not match + // the default AS, case in which we AS cast it, or we have a trivial + // type mismatch, and thus perform a bitcast to coerce it. ---------------- arsenm wrote:
The cast is probably unavoidable here. You need to support flat addressing for any of c++ to work anyway, so that's fine for the GPU case https://github.com/llvm/llvm-project/pull/114062 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits