hliao marked an inline comment as done.
hliao added inline comments.

================
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
previous assertion expression gets the same goal, if ABI is different, the stub 
name from device-side should match the stub name from the host-side 
compilation. As we add a dedicated interface to the derive stub name, we could 
simplify the comparison to a single one.
Also, we put the simple condition checking ahead (a common practice) to reduce 
the overhead of string comparison


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