[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 11:29:05 PDT 2022


jhuber6 added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6836
+
+  // If the CUID is not specified we try to generate a unique postfix.
+  if (getLangOpts().CUID.empty()) {
----------------
tra wrote:
> > However, [CUID] is not always availible. 
> 
> The question is -- when and why is it not available? I'm getting the feeling that we're fixing the consequence here, not the root cause.
> 
> Is there a reason we can't make sure that the driver always generates a cuid for offload subcompilations and error out if it's needed but is not provided?
> That would make this fallback unnecessary and would be a more robust approach in general.
> 
So, I'm more in favor of this approach because it doesn't require extra intervention from the compiler driver, this makes it less convoluted to do split compilation since we don't have an extra arguments. The way I would prefer it, is that we do this implicitly by default without requiring extra thought from the driver, but if it's not good enough we can support the manual `CUID` approach to let the user override it. I think this is a cleaner implementation, and is mostly coming from my support for CUDA in the new driver which currently doesn't implement the CUID as we do with the old driver. Generally I'd prefer things to behave independent of the driver, so we can consider host and device compilation more separately.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125904



More information about the cfe-commits mailing list