================ @@ -2209,6 +2209,18 @@ void CodeGenFunction::EmitStoreOfScalar(llvm::Value *Value, Address Addr, } } + // When storing a pointer, perform address space cast if needed. ---------------- macurtis-amd wrote:
Thanks for the explanation. I actually did some more investigation and determined that the mismatched address space originates in the [the `NVRO` branch](https://github.com/llvm/llvm-project/blob/35be64a416813c91bd267cfe11f31ef024c7143b/clang/lib/CodeGen/CGDecl.cpp#L1566) of [`EmitAutoVarAlloca`](https://github.com/llvm/llvm-project/blob/35be64a416813c91bd267cfe11f31ef024c7143b/clang/lib/CodeGen/CGDecl.cpp#L1483). While `AllocaAddr` is ok in `addrspace(5)`, `address` is really expected to be in the default address space and the `NVRO` branch needs something like the code [here](https://github.com/llvm/llvm-project/blob/35be64a416813c91bd267cfe11f31ef024c7143b/clang/lib/CodeGen/CGExpr.cpp#L124). Does this sound right to you? https://github.com/llvm/llvm-project/pull/154380 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits