yaxunl added inline comments.

================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:15764
+        AddrParamTy->getPointerElementType() == 
AddrTy->getPointerElementType())
+      Addr = Builder.CreateAddrSpaceCast(Addr, AddrParamTy);
     return Builder.CreateCall(F, {Addr, Val, ZeroI32, ZeroI32, ZeroI1});
----------------
In https://reviews.llvm.org/D102405 you already inserted an addr space cast in 
AST when you pass a pointer to default addr space to a builtin expecting a 
pointer to non-default addr space. This addr space cast in AST will be emitted 
as addr space cast in IR. Why do you still need to insert addr space cast here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110772/new/

https://reviews.llvm.org/D110772

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to