[PATCH] D55067: [HIP] Fix offset of kernel argument for AMDGPU target

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 29 13:56:09 PST 2018


arsenm added inline comments.


================
Comment at: lib/CodeGen/CGCUDANV.cpp:205
+    auto *Aux = CGM.getContext().getAuxTargetInfo();
+    if (Aux && Aux->getTriple().getArch() == llvm::Triple::amdgcn) {
+      auto *ArgTy = Arg->getType()->getPointerElementType();
----------------
yaxunl wrote:
> arsenm wrote:
> > Checking the specific target seems wrong. Shouldn't you just need to check if the value is byval or not?
> This is in the host code gen for the kernel stub function, where the struct argument is always by val for x86_64. We cannot use that to differentiate between nvptx and amdgcn.
No, you need to see what the lowering behavior is for the argument type in the device's calling convention


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

https://reviews.llvm.org/D55067





More information about the cfe-commits mailing list