yaxunl marked an inline comment as done. yaxunl added inline comments.
================ Comment at: lib/CodeGen/CGCall.cpp:3861 < Align.getQuantity()) || (ArgInfo.getIndirectByVal() && (RVAddrSpace != ArgAddrSpace))) { // Create an aligned temporary, and copy to it. ---------------- rjmccall wrote: > This should be comparing AST address spaces. The AST address space of RV cannot be obtained through `CGFunctionInfo::const_arg_iterator it` and `it->type` since `it->type` takes type of ``` ImplicitCastExpr 0x60a9ff0 <col:5> 'struct S':'struct S' <LValueToRValue> `-DeclRefExpr 0x60a9f28 <col:5> '__global struct S':'__global struct S' lvalue Var 0x607efb0 ``` and the original addr space is lost due to LValueToRValue cast. To get the AST addr space of RV, it seems I need to save the argument Expr in CallArgList and get it from Expr. https://reviews.llvm.org/D34367 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits