[PATCH] D69818: [HIP] Fix pointer type kernel arg for amdgpu

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 14:11:14 PST 2019


yaxunl marked an inline comment as done.
yaxunl added a comment.

BTW Michael Liao will create another patch which will supersede this patch. That patch contains similar changes and also handles pointers in a byval struct or array.



================
Comment at: clang/lib/CodeGen/CGCall.cpp:1172
     if (isa<llvm::PointerType>(Ty))
-      return CGF.Builder.CreateBitCast(Val, Ty, "coerce.val");
+      return CGF.Builder.CreatePointerCast(Val, Ty, "coerce.val");
 
----------------
tra wrote:
> What's the purpose of this change?
this is supposed to cast the coerced type to the original type. Previously, no coerced type changes the address space, therefore a bitcast is sufficient. Now we coerce a type to different address space, therefore we need a pointer cast.


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

https://reviews.llvm.org/D69818





More information about the cfe-commits mailing list