tra added a comment.

In D63335#1543845 <https://reviews.llvm.org/D63335#1543845>, @hliao wrote:

> it's requested from debugger people. they don't want to the host-side stub 
> could match the device-side kernel function name. the previous scheme cannot 
> prevent that.


I understand that you want a different name for the stub. My question is why 
the ".stub" suffix was not sufficient and how does having a prefix instead 
helps? Making the name un-demangleable is undesirable, IMO. There should be a 
good reason to justify it.



================
Comment at: clang/lib/CodeGen/CGCUDANV.cpp:222-226
+  assert((CGF.CGM.getContext().getAuxTargetInfo() &&
+          (CGF.CGM.getContext().getAuxTargetInfo()->getCXXABI() !=
+           CGF.CGM.getContext().getTargetInfo().getCXXABI())) ||
+         getDeviceStubName(getDeviceSideName(CGF.CurFuncDecl)) ==
+             CGF.CurFn->getName());
----------------
hliao wrote:
> tra wrote:
> > I'm not sure I understand what exactly this assertion checks.
> > The condition appears to be true is host/device ABIs are different OR the 
> > name of the current function is the same as the (possibly mangled) 
> > device-side name + __device_stub_ prefix.
> > 
> > While the first part makes sense, I'm not sure I understand the name 
> > comparison part.
> > Could you tell me more and, maybe, add a comment explaining what's going on 
> > here.
> The second is to ensure, if, under the same ABI, kernel stub name derived 
> from device-side name mangling should be the same the sub name generated from 
> host-side, CGF.CurFn->getName() is the mangled named from host compilation
This definitely needs a comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63335



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

Reply via email to