tra added subscribers: kpyzhov, rnk.
tra added inline comments.

================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:4290-4293
-  // Do not set COMDAT attribute for CUDA/HIP stub functions to prevent
-  // them being "merged" by the COMDAT Folding linker optimization.
-  if (D.hasAttr<CUDAGlobalAttr>())
-    return false;
----------------
This was added in D63277 specifically to deal with comdat-related issue on 
windows. 

We do need to have unique addresses for each kernel stub. Placing stubs into 
comdat may allow them to be merged into one and that would be a problem.
https://docs.microsoft.com/en-us/cpp/build/reference/opt-optimizations?view=vs-2019
 

@rnk,@kpyzhov -- how do we make sure that identical functions are placed in 
comdat (needed for templates) but do not get comdat-folded with `/OPT:ICF`? 



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

https://reviews.llvm.org/D112492

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

Reply via email to